Use this webservice to request an access token.
Token expiration and recommended flow
Access tokens expire every 14 days by default (the duration can vary per client — check expires_in in the response). When a token expires or your app loses it, any call will return a HTTP 403 error. In that case your app should call this /authorize method again to get a new token and continue performing the original operation. You can also generate a token manually at https://mapaprop.github.io.
Resource URL
https://mapaprop.app/api/action/oauth2-v1/authorize
Parameters
| Key | Type | Required | Description |
|---|---|---|---|
| client_id | string | yes | The CLIENT ID provided by Mapaprop |
| client_secret | string | yes | The CLIENT SECRET provided by Mapaprop |
| grant_type | string | yes | Use the constant text client_credentials |
Sample code
POST /api/action/oauth2-v1/authorize HTTP/1.1
Host: mapaprop.app
Content-Type: application/x-www-form-urlencoded
Content-Length: 0
client_id=jfioejweu8wu9fjsHUGldfja9ofwjf&client_secret=UHY&T&FOIHuihd8w2hg3kh8Y&grant_type=client_credentials
Response
You have to parse the JSON response in order to obtain your access token.
| Object | Field | Type | Required | Description |
|---|---|---|---|---|
| Response | accessToken | string | yes | The access token needed for verification |
| access_token | string | yes | Same value as accessToken (snake_case alias) | |
| tokenType | string | yes | Always Bearer | |
| expires_in | int | yes | Seconds until the token expires (default 1209600 = 14 days; may vary per client) |
Sample code
{
"accessToken": "7147c222b5989488fd14d28d20e099b0",
"access_token": "7147c222b5989488fd14d28d20e099b0",
"tokenType": "Bearer",
"expires_in": 1209600
}