Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Table of Contents

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 GET request to the endpoint /api/ipn/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/ipn/account/get/tokens/{:token}

HTTP method

POSTGET

Attributes of the HTTP request

...

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

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

Code Block
languagejson
# HTTP POST
# https://appipn.dev.thinksurance.de/api/ipn/account/get/tokens/{:token}
# 'Content-TypeAuthorization': 'application/jsonBearer <some long string value>'
# 'Accept': 'application/json'

Successful HTTP Response

Code Block
languagejson
# HTTP 200 status code
# 'Content-Type': 'application/json'
{
  "aToken": "<some hashed string>"
}

Failed HTTP Response

Code Block
languagejson
# HTTP 200 status code
# 'Content-Type': 'application/json'
{
  "error": "API User is not existing or deactivated."
}