Get Map Token

Retrieve a map token by a given JWT Token to allow SPL clients accessing A secure map service hosted in SPL enterprise GIS environment through their applications.

Usage:

You must use an access token to make an authenticated call to our system. Access token are generated based on your subscription type. To get your access token please refer to “Your Subscriptions” section available on profile page.

Limits for calls to API

Our system doesn’t apply any limits on number of requests you can make for a particular API. But there are limits defined for total number of calls you can make per min and in one week. 

API Request 
Input Parameters

Field Description
referrer Valid domain name (localhost or https://example.com)
Authorization Bearer token
api_key Access token to authenticate you as a valid user of the system. Please refer to profile section to get your subscription key.

 

Requested URL

https://apina.address.gov.sa/MapToken/GetVectorMapToken?referrer=<referrer>&api_key=<apikey>

Response

Default Fields Returned

By default, only the following fields are returned for a profile request:

FieldDescription
succeeded This represents success or failure of the request itself (true/false).
mapToken The requested map token.
expiresIn The token validity in seconds.

Sample Response
JSON

{
    "succeeded": true,
    "mapToken": "WOErqbSGa3g9hJ_QkQbsP9fJwCTXBRdEm1bg-HOmAcLn4f0OmZGL4X_d8VyKnD1-IHoRwVmVauJBErXgg1TL4Wql6-xE_FqMEyXnaiSjLOnecU1GxA27l7LIB9ThVONpjhMvv4n6kyiHec2D3u5W-g..",
    "expiresIn": 60
}


Common Errors

If there's an error with your API call, tje API will return a HTTP status code along with a message detailing the error.

CodeDescriptionSolution
401 "Access denied due to invalid subscription key. Make sure you are subscribed to an API you are trying to call and provide the right key." Ensure that a valid access token is being used in your API call By catching 401 unauthorized exceptions in all your calls you'll provide the coverage you need in your application to handle expired tokens. It's good practice to design and develop your application in anticipation that with any request you could potentially have an invalid access token.
404 Page not found The endpoint or resource your application is trying to reach doesn't exist
405 Method Not Allowed.
500 Internal Service Error There was an application error on our server. Usually your request is valid but needs to be made at a later time.