I'm working on integrating LearnDash LMS with my application using the LearnDash REST API, and I'm facing an issue with the course users endpoint in version 2 of the API. When I make a request to retrieve users enrolled in a specific course using LearnDash LMS REST API v2, it returns all users instead of just the users enrolled in that course.
I have ensured that I'm providing the correct Course ID in the request URL, and I'm properly authenticated with the API. However, the response I'm getting includes all users, regardless of their course enrollment status.
Here's an example of the API request I'm making:
GET http://learndash.local/wp-json/ldlms/v2/sfwd-courses/19/users
Interestingly, I have noticed that this issue does not occur when using the v1 of the LearnDash REST API. In v1, the API correctly returns only the users who are enrolled in the specified course.
Is there something specific to the v2 of the API that I need to configure or include in my request to ensure that I only receive the users who are enrolled in the specified course, similar to how it works in v1? Any insights or guidance on how to resolve this issue in v2 would be greatly appreciated.