API Request ERROR!
-
Hi!
I use API and GET request https://mysite.com/wp-json/llms/v1/students
And I got error – You are not allowed to list students
BUT My Consumer Key and Consumer Secret are correct. And Permissions READ/WRITEplease help with this!!!
-
In order to list students through the REST API endpoint in question the user who owns the API credentials must have the
view_studentscapability.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_studentscapability to the role of your user/choice to allow you to access this API endpoint.Let me know if that helps,
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
My user has view_students capabilit
But i still got error – You are not allowed to list students
Why?Hi @seyrandev
is your site using the ssl/tls protocol and are you doing your requests to “the https url”?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.
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.
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/CVb5KqPMUzn1raPJj7Fl3VXRXXWJj1Make the request with
context=editto 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,
-
This reply was modified 6 years, 4 months ago by
The topic ‘API Request ERROR!’ is closed to new replies.