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/ipn/brokers/tokens.
Endpoint
To create a broker via the API, it is imperative to send an HTTP POST request to the endpoint /api/ipn/brokers/tokens. The rest of the HTTP request is a JSON payload of the request body.
Action name | create broker |
---|---|
HTTP path | /api/ipn/brokers/tokens |
HTTP method | POST |
Attributes of the HTTP request
HTTP Request Header | |||
---|---|---|---|
Authorization | string | required | A security token provided from Authentication endpoint. |
X-Account-Token | string | required | An unique identifier of the account. |
Attributes of the HTTP request
type | int | required | Enumeration value that defines the way for mapping broker data from the request:
|
---|---|---|---|
bExternalId | string | required | Broker’s ID from the partner system. |
bLastName | string | optional1 | Broker person’s last name. |
bEmail | string | required | Broker person’s email address. |
bCompany | string | optional2 | Broker company’s name. |
Explanations: 1 required if bCompany is not set |
Attributes of the HTTP response
Success response | |||
---|---|---|---|
JSON array of objects containing: | |||
status | string | required | A text providing more information on the succesful operation. |
bToken | string | required | An identifier for the new broker. |
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/ipn/brokers/token endpoint of the API. Below, instances of potential communication between the API and consumers are provided.
HTTP Request with minimal data for a person |
# HTTP POST # https://ipn.dev.thinksurance.de/api/ipn/brokers/token # 'Content-Type': 'application/json' # 'Accept': 'application/json' # 'X-Account-Token: "<some hash>" # 'Authorization: Bearer "<some long hash>" { "type": 1, "bExternalId": "T5", "bEmail": "mustermann@email.com", "bLastName": "Mustermann" } |
Successful HTTP Response |
# HTTP 200 status code # 'Content-Type': 'application/json' { "status": "Broker Api: existing broker for the provided request.", "bToken": "<bToken>" } |
Failed HTTP Response |
# HTTP 200 status code # 'Content-Type': 'application/json' { "error": "API User is not existing or deactivated." } |