V1.1 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 GET request to the endpoint /api/ipn/account/tokens.

Action name

get account token

HTTP path

/api/ipn/account/tokens

HTTP method

GET

Attributes of the HTTP request

HTTP Request Header

HTTP Request Header

Authorization

string

required

A security token provided from Authentication endpoint.
Required to provide as a Bearer Token (in format: “Bearer {{token}}“).

Attributes of the HTTP response

Success response

Success response

JSON object 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://ipn.dev.thinksurance.de/api/ipn/account/tokens # 'Authorization': 'Bearer <some long string value>' # '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." }