Request and response structure
The API is HTTP and JSON-based. Data passed in POST and PUT requests is stored in the body as JSON. In responses, the data is also stored in the body response and structured as JSON.
Before requesting any endpoint, you will need to get a bearer token.
Bearer Token
A "Bearer Token" is a JSON Web Token whose role is to indicate that you are authenticated when you consult resources.
To send requests to the web service in charge of attributing a token, you need :
- a client ID
- a client secret
- a host
please contact your Teach on Mars Project Manager to get them.
You retrieve this token as shown below. The grant_type, client_id and client_id are sent as form-data.
The Mission Center response should be
Response:
{
"access_token": "9gSxjf8O_gDxAROS5_xYW_C2Hkqxem36tO8VpT8wUqM",
"expires_in": 3600,
"token_type": "Bearer",
"scope": "client_access"
}
Then you must send the bearer token with each request to ensure it is valid.
Find all the technical information in the swagger
Parameter Instance
Once you have your bearer token, you can start sending request to the Teach on Mars web services. If you want to get the learners from all your Mission Center, you can omit the instance Id
GET {{host}}/api/identities/v1/learners
But if you want to send requests to a specific Mission Center instance, you can add the parameters.
GET {{host}}/api/identities/v1/learners?instance={{instance}}
Comments
0 comments
Please sign in to leave a comment.