Viewing 9 replies - 1 through 9 (of 9 total)
  • @seyrandev

    In order to list students through the REST API endpoint in question the user who owns the API credentials must have the view_students capability.

    This capability is added to the WordPress core administrator role and to the LifterLMS custom roles “LMS Manager”, “Insturctor”, and “Instructor’s Assistant.”

    In order to use this API endpoint ensure that the user owning the API Credentials you’re using is one of these roles or you can use a role editor plugin in order to add the view_students capability to the role of your user/choice to allow you to access this API endpoint.

    Let me know if that helps,

    Thread Starter seyrandev

    (@seyrandev)

    My user already has a role core administrator, but I still got this error – You are not allowed to list students.

    Can you record a short video for me? Please check this API endpoint.

    Thanks

    Thread Starter seyrandev

    (@seyrandev)

    My user has view_students capabilit
    But i still got error – You are not allowed to list students
    Why?

    Plugin Contributor Rocco Aliberti

    (@d4z_c0nf)

    Hi @seyrandev
    is your site using the ssl/tls protocol and are you doing your requests to “the https url”?

    Thread Starter seyrandev

    (@seyrandev)

    Sure. Using SSL and https:// protocol.
    All API request works fine(Create student, create student enrollments, delete student enrollments), except GET students.

    • This reply was modified 6 years, 4 months ago by seyrandev.
    Thread Starter seyrandev

    (@seyrandev)

    @seyrandev,

    I’m not seeing any issues locally with this endpoint.

    Your system report doesn’t appear to identify any obvious plugin conflicts or errors.

    Are you receiving a 403 or a 401 error? A 401, which I believe is what you’re encountering, is an error that indicates your credentials are not being verified at all while a 403 would indicate that your credentials are valid but do not provide you with permission to perform the action in question.

    It’s possible that you’re encountering an issue of server configurations where your server does not accept basic authorization on a GET request. Could you try using the header authentication method outlined at https://developer.lifterlms.com/rest-api/#section/Authentication/Header-Authentication

    This will use the fallback authentication method and if this is the issue you’re encountering should allow your api credentials to be read by the server.

    Thread Starter seyrandev

    (@seyrandev)

    Ok. I create API request with POSTMAN and see i got a result but this is the result wrong (Email address missing) response structure different with your API documentation response example
    My response – https://monosnap.com/file/aoavktS0uMTyLNyFqig8vpZ0sdNpmS
    Your example API /students response – https://monosnap.com/file/CVb5KqPMUzn1raPJj7Fl3VXRXXWJj1

    @seyrandev

    Make the request with context=edit to see all student information.

    By default we only return “public” student information in the view context. This follows conventions set forth by the WordPress core REST API endpoints for user data.

    Hope that helps,

Viewing 9 replies - 1 through 9 (of 9 total)

The topic ‘API Request ERROR!’ is closed to new replies.