Regenerate Admin Key
Purpose
This endpoint is used to regenerate an Admin Key using a previous secret value. Should an existing Admin Key become compromised, lost, or just needs to be changed for any reason, a new Admin Key can be generated using this endpoint. At the same time, when a new Admin Key is regenerated the previous one gets revoked.
Request Data
HTTPS method: POST
- Constants and parameters enclosed in curly brackets { } must be replaced with their values.
- Please see the following Request parameters section with the required and optional parameters tables for their values. The generic request format is as follows.
URL request format
https://{baseURL}/locationHistory/{versionNumber}/regenerateKey?key={Your_API_Key}
curl command request format
1curl -XPOST "Content-type: application/json" -d2'{3 "secret": "secret_key";4 };'5'https://{baseURL}/locationHistory/{versionNumber}/regenerateKey?key={Your_API_Key}'
POST request body format
1{2 "secret": "secret_key"3}
Request parameters
The following table describes the parameters that can be used in a request.
- Required parameters must be used or the call will fail.
- Optional parameters may be used.
- The order of request parameters is not important.
Note: There are no optional parameters in this endpoint.
Required parameters | Description |
---|---|
string | The base URL for calling the API. Value: |
string | Service version number. Value: |
string | An API Key valid for the requested service. Value: Your valid |
Response data
Response body
1{2 "adminKey": "<string>"3}
Response fields
The following data tables describe all of the fields that can appear in a response.
Primary fields | Description |
---|---|
string | A generated Admin Key that can be used to manage location history objects. |
Response codes
Code | Meaning and possible causes |
---|---|
| OK: Configuration registered. Admin Key regenerated. |
| Bad request: Missing or invalid request data. |
| Unauthorized: Provided secret is invalid. |
Example
Regenerate an Admin Key using a passed secret value.
Request URL example
https://api.tomtom.com/locationHistory/1/regenerateKey?key={Your_API_Key}
POST body example
1{2 "secret" "Secret value"3}
Response body example
The following JSON code block demonstrates a successful response from the API server.
1{2 "adminKey: UpP9m2jg4PU6fWAFnvskU33CwfW24e17P0oTC5byUfUzMElS"3}