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 create a new broker within a specific account utilizing the Thinksurance Public API V1, henceforth referred to as "the API," a dedicated endpoint facilitates this capability. This endpoint is accessible at the path /api/broker/set/{: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/broker/set/{: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

create broker

HTTP path

/api/products/broker/set/{:token}

HTTP method

POST

Attributes of the HTTP request

...

Broker Parameters

The initial set of parameters pertains to broker data. Only specific elements within this data subset are mandatory for delivery. These required elements assist the API in providing critical information for the broker creation.

aToken

string

required

A

security token provided from Authentication endpoint.

professionId

int

optional

An attribute used to filter out all products for particular profession.

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.

bGender

int

optional

Enumeration value that defines salutation of the broker person:

  • 1 - Mr

  • 2 - Ms

bFirstName

string

optional

Broker person’s first name.

bLastName

string

required1

Broker person’s last name.

bEmail

string

required

Broker person’s email address.

bCompany

string

required2

Broker company’s name.

bStreet

string

optional

Broker company’s street name.

bStreetNumber

string

optional

Broker company’s street number.

bZip

string

optional

Broker company’s postcode.

bCity

string

optional

Broker company’s city.

bPhone

string

optional

Broker company’s phone number.

bCompanyRegNumber

string

optional

Broker company’s commercial register number.

bRegNumber

string

optional

Broker company’s IHK register number.

Explanations:

Anchor
broker
broker
isMissingRequiredParameterstrue

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

Attributes of the HTTP response

name

Success response

JSON array of objects containing:

idstatus

intstring

required

An unique identifier of the product.

A text providing more information on the succesful operation.

bToken

string

requiredA

product’s nameAn identifier for the new broker.

Failed response

error

string

required

It contains a reason for the failed request.

Examples

...

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

HTTP Request with minimal data for company

Code Block
# HTTP POST
# /api/products/broker/set/{:token}
# 'Content-Type': 'application/json'
# 'Accept': 'application/json'
{
  "tokenaToken": "some long string value string as an identifier",
  "type": 1,
  "bExternalId": "T5",
  "bEmail": "awesome.gmbh@email.com",
  "bCompany": "Awesome GmbH"
}

HTTP Request with profession filterminimal data for a person

Code Block
# HTTP POST
# /api/products/broker/set/{:token}
# 'Content-Type': 'application/json'
# 'Accept': 'application/json'
{
  "tokenaToken": "some long string value string as an identifier",
  "type": 1,
  "bExternalId": "T5",
  "bEmail": "mustermann@email.com",
  "professionIdbLastName": 123"Mustermann"
}

Successful HTTP Response

Code Block
# HTTP 200 status code
# 'Content-Type': 'application/json'
[

 {
 
  "idstatus": 1,
    "name": "Product1"
  },
  {
    "id": 2,
    "name"Broker Api: broker created succesfully.",
  "bToken": "Product2"some hashed string"
}
]

Failed HTTP Response

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