OAuth API
URL
https://outpost.mapmyindia.com/api/security/oauth/token
Method
POST
Request Parameters
All parameters are mandatory and invalid values in either of them would lead to a 400: Bad Request.
The request parameters would be sent in the format of “x-www-form-urlencoded”.
The body of the request must contain the below information:
- grant_type: Defines the type of access token requested. Keep “client_credentials” in value.
- client_id: Would be the identifier of the client that is using the Atlas services.
- client_secret: would be the secret key provided to the client to verify the client ID.
It’s advisable not to store or create a constant value of the clientID and clientSecret for security reasons.
Request Headers
- Content-Type: Defines the type of content being sent to the API. It must be set to “application/x-www-form- urlencoded”.
Please note: sending any request without it or different than it would lead to a 400: Bad request.
Response Type
- The API would return a JSON response.
Response Codes {as HTTP response code}
Success:
- 201: To denote a successful API call, that the access token has been created.
Client-Side Issues:
- 400: Bad Request, User made an error while creating a valid request.
- 401: Unauthorized, if the clientID doesn’t exist or an invalid clientSecret is provided.
- 403: Forbidden, Client has hit its daily/hourly limit
Response Messages (as HTTP response message)
- 200: Access Created.
- 400: Something’s just not right with the request. {mention what’s not right}
- 401: Access Denied. The clientID doesn’t exist or invalid clientSecret (whichever is true)
- 403: Services for this client has been suspended due to daily/hourly transactions limit.
- 500: Something went wrong.
- 503: Maintenance Break.
Response Parameters
- token (string): the type of token received from the request.
- access_token (string): the access token for the current session to interact with Atlas APIs.
- scope (string): the permissions that are allowed to the client.
- expires_in (long): the time for the token to expire in second
Sample Response data
{
"token_type": "bearer",
"access_token": "AAAA%2FAAA%3DAAAAAAAA",
"scope": "READ",
"expires_in": 1560
}