How to use the API that need authentication

Sorry but I’m new here.

So this question maybe silly, but I’ve read API doc from https://courses.edx.org/api-docs/

There are some API that need to authenticate, which I cannot know how to do it, I tried to search all the internet for the guide but seem unlucky.

So can anyone give me advice how to do it ?

Beside, I’ve another question, I want to know which API I can use to enroll specific user to a course ? It would be great if someone can help me with that.

So sorry about the silly question.

Hey @Nguyen_Kain

  1. The authentication methods vary for each API. some are working with a session authentication (a user is authenticated after submitting username& password from login page) and some are working with JWT or Bear authentication (calling an API initially to get a token).
  2. I’m not sure but this API may be what you’re looking for

Hi @mahyard

  1. I use API from 3rd party system, so there is no login form. If there is JWT token, there must be an API to login with account and get the token, which I dont see it in the document.

  2. I believe your API only GET all course of user, not to enroll user to course. If there is API like that, I think it must be POST or PUT method, not GET.

  1. take a look at this document

  2. I have no idea about it. you may be able to use it as a clue to go further.

Hi @mahyard

Thank you for your resposnse.

  1. I’ve already taken a look at this document, it seem apply for edx.org, but not for custom Edx host.
  2. I will try looking more for the solution.

Again, thank you for answer my silly question.

you are welcome,
actually, that file is written for edx.org. but you are using the same application and there are many concepts and definitions. so I found every single line of that document useful. just replace edx.org and its subdomains with the right URL for your instance. if you are on a simple installation, all the URLs are the same as your LMS address.