Open awais786 opened 5 months ago
PRS List
Testing guide lines via postman
How to generate csrf http://local.edly.io:8000/csrf/api/v1/token It will return the csrf token which is required for some apis.
For login authentication
http://local.edly.io:8000/api/user/v2/account/login_session/
body-form-data
email_or_username = admin
password = edx
headers information
x-csrftoken: csrf fresh token
Generate access token via postman http://local.edly.io:8000/oauth2/access_token
You can curl command as well as follows. Just pass your token.
curl --location ‘http://local.edly.io:8000/courses/course-v1:edx+cs222+2311/instructor/api/get_student_progress_url’
–header ‘Authorization: JWT eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJhdWQiOiJvcGVuZWR4IiwiZXhwIjoxNzI0MjMzNDc2LCJncmFudF90eXBlIjoiY2xpZW50LWNyZWRlbnRpYWxzIiwiaWF0IjoxNzI0MjI5ODc2LCJpc3MiOiJodHRwOi8vbG9jYWwuZWRseS5pby9vYXV0aDIiLCJwcmVmZXJyZWRfdXNlcm5hbWUiOiNlX3VzZXIiLCJzY29wZXMiOlsicmVhZCIsIndyaXRlIiwiZW1haWwiLCJwcm9maWxlIl0sInZlcnNpb24iOiIxLjIuMCIsInN1YiI6IjI2MjYyNDAxYzUyOGQ3YzRhNmJiZWFiZTA0NTVlYzQ2IiwiZmlsdGVycyI6W10sImlzX3Jlc3RyaWN0ZWQiOmZhbHNlLCJlbWFpbF92ZXJpZmllZCI6dHJ1ZSwiZW1haWwiOiJsb2dpbl9zZXJ2aWNlX3VzZXJAZmFrZS5lbWFpbCIsIm5hbWUiOm51bGwsImZhbWlseV9uYW1lIjoiIiwiZ2l2ZW5fbmFtZSI6IiIsImFkbWluaXN0cmF0b3IiOmZhbHNlLCJzdXBlcnVzZXIiOmZhbHNlfQ.t1GjtoPntvTgY153qlkoUHZ2N43U-Ac5uJY5EUTEo0g’
-X POST --form ‘unique_student_identifier=“audot”’
Amazing list and job @awais786 ! thank you very much for this very relevant list ! Where can we find the postman workspace & collections ? Thanks. Amaury
@AmauryVanEspen you can find some help material from here
Please let me know if you have some questions.
Hi @awais786 trying to set up the Postman Collection, with the CSRF tricks, i still have an issue https://openedx.atlassian.net/wiki/spaces/AC/pages/3516268561/How+to+authenticate+and+query+edX+APIs+with+Postman returning : 405 Method Not Allowed
not sure about how to add the script : var xsrfCookie = postman.getResponseCookie("csrftoken"); postman.setEnvironmentVariable('csrftoken', xsrfCookie.value);
collection folder ? the post-request script of the POST ? Thanks. Amaury
Hi @awais786 trying to set up the Postman Collection, with the CSRF tricks, i still have an issue https://openedx.atlassian.net/wiki/spaces/AC/pages/3516268561/How+to+authenticate+and+query+edX+APIs+with+Postman returning : 405 Method Not Allowed
not sure about how to add the script : var xsrfCookie = postman.getResponseCookie("csrftoken"); postman.setEnvironmentVariable('csrftoken', xsrfCookie.value);
collection folder ? the post-request script of the POST ? Thanks. Amaury
Please try this. https://discuss.openedx.org/t/authenticate-with-oauth-token-to-access-api-endpoints-instructor-apis-d/13658
@AmauryVanEspen Please check the last post with postman collection
@AmauryVanEspen Please check the last post with postman collection
hi @awais786 thanks, which instance should i use ? prod ? or a simple EduNExt Trial ? or is there an instance available for migration LMS API to DRF available ? Thanks Regards Amaury
@AmauryVanEspen I am using local tutor instance for testing purpose.
This document Big changes to edx-platform contains a segment to convert
Improve HTTP APIs.
How to test Instructor APIS