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:

  1. grant_type: Defines the type of access token requested. Keep “client_credentials” in value.
  2. client_id: Would be the identifier of the client that is using the Atlas services.
  3. 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
  1. 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
  1. The API would return a JSON response.

Response Codes {as HTTP response code}

Success:
  1. 201: To denote a successful API call, that the access token has been created.
Client-Side Issues:
  1. 400: Bad Request, User made an error while creating a valid request.
  2. 401: Unauthorized, if the clientID doesn’t exist or an invalid clientSecret is provided.
  3. 403: Forbidden, Client has hit its daily/hourly limit

Response Messages (as HTTP response message)

  1. 200: Access Created.
  2. 400: Something’s just not right with the request. {mention what’s not right}
  3. 401: Access Denied. The clientID doesn’t exist or invalid clientSecret (whichever is true)
  4. 403: Services for this client has been suspended due to daily/hourly transactions limit.
  5. 500: Something went wrong.
  6. 503: Maintenance Break.

Response Parameters

  1. token (string): the type of token received from the request.
  2. access_token (string): the access token for the current session to interact with Atlas APIs.
  3. scope (string): the permissions that are allowed to the client.
  4. 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  }