V1 Get Broker Token

Introduction

In instances where there is needed to get a Broker Token (or, sometimes referred as “bToken”), the Thinksurance Public API V1, henceforth referred to as "the API," provides a dedicated endpoint that facilitates this capability. This endpoint is accessible at the path /api/broker/get/{:token}.

Endpoint

To get a broker’s token via the API, it is imperative to send an HTTP POST request to the endpoint /api/broker/get/{:token}, where token represents a security token retrieved from Authentication. The rest of the HTTP request is a JSON payload of the request body.

Action name

get broker token

HTTP path

/api/broker/get/{:token}

HTTP method

POST

Attributes of the HTTP request

aToken

string

required

A special token used for accounts to identify itself during API calls. Provided by Thinksurance Support Team.

type

int

required

Enumeration value that defines the way for mapping broker data from the request:

  • 1 - it requires to have broker’s ID from the partner system provided to Thinksurance System

  • 2 - it doesn’t requires to have broker’s ID from the partner system provided to Thinksurance System

bExternalId

string

required

Broker’s ID from the partner system.

bLastName

string

optional1

Broker person’s last name.

bEmail

string

optional

Broker person’s email address.

bCompany

string

optional2

Broker company’s name.

Explanations:

1 required if bCompany is not set
2 required if bLastName is not set

Attributes of the HTTP response

Success response

Success response

JSON array of objects containing:

bToken

string

required

An identifier for the new broker.

bLastName

string

optional

Broker person’s last name.

bEmail

string

required

Broker person’s email address.

bCompany

string

optional

Broker company’s name.

bCode

string

required

Broker’s code, used for Consult Direct.

Failed response

error

string

required

It contains a reason for the failed request.

Examples

As previously stated, to execute Get Broker Token, it is imperative to dispatch a POST HTTP request to the /api/broker/get/{:token} endpoint of the API. Below, instances of potential communication between the API and consumers are provided.

HTTP Request with minimal data for company

# HTTP POST # https://app.dev.thinksurance.de/api/broker/get/<some long hash> # 'Content-Type': 'application/json' # 'Accept': 'application/json' { "aToken": "<some hash>", "type": 1, "bExternalId": "T5", "bEmail": "awesome.gmbh@email.com", "bCompany": "Awesome GmbH" }

HTTP Request with minimal data for a person

# HTTP POST # https://app.dev.thinksurance.de/api/broker/get/<some long hash> # 'Content-Type': 'application/json' # 'Accept': 'application/json' { "aToken": "<some hash>", "type": 1, "bExternalId": "T5", "bEmail": "mustermann@email.com", "bLastName": "Mustermann" }

Successful HTTP Response

# HTTP 200 status code # 'Content-Type': 'application/json' { "bToken": "<some hash>", "bExternalId": "T5", "bEmail": "mustermann@email.com", "bLastName": "Mustermann" "bCode": "<some hash>" }

Failed HTTP Response