V1 Get Account Token
Introduction
In instances where there is a need to get the Account Token of the current user defined by the security token, by using the Thinksurance Public API V1, referred to as "the API," a dedicated endpoint facilitates this capability. This endpoint is accessible at the path /api/account/get/tokens/{:token}. It anticipates a comprehensive payload as part of the HTTP request, encompassing the requisite broker data.
Endpoint
To create a broker via the API, it is imperative to send an HTTP POST request to the endpoint /api/account/get/tokens/{:token}. The parameterised segment of the endpoint, denoted as "{:token}," contains to the security token retrievable by the partner during the Authentication process on the API. The rest of the HTTP request is a JSON payload of the request body.
Action name | get account token |
---|---|
HTTP path | /api/account/get/tokens/{:token}
|
HTTP method | POST |
Attributes of the HTTP request
No parameters are expected in the HTTP request body.
Attributes of the HTTP response
Success response | |||
---|---|---|---|
JSON array of objects containing: | |||
name | string | required | A name for the requested account. |
aToken | string | required | An identifier for the requested account. |
Failed response | |||
error | string | required | It contains a reason for the failed request. |
Examples
As previously stated, to execute get account token, it is imperative to dispatch a POST HTTP request to the /api/account/get/tokens/{:token} endpoint of the API. Below, instances of potential communication between the API and consumers are provided.
HTTP Request |
# HTTP POST
# https://app.dev.thinksurance.de/api/account/get/tokens/{:token}
# 'Content-Type': 'application/json'
# 'Accept': 'application/json' |
Successful HTTP Response |
# HTTP 200 status code
# 'Content-Type': 'application/json'
{
"aToken": "<some hashed string>"
} |
Failed HTTP Response |
# HTTP 200 status code
# 'Content-Type': 'application/json'
{
"error": "API User is not existing or deactivated."
} |