Introduction
To obtain a list of insurance products, the Thinksurance Public API V1 (referred to as "the API") provides a dedicated endpoint designed specifically for this purpose. This endpoint enables consumers to retrieve either the complete list of insurance products or filter them based on the profession.
Endpoint
To retrieve products, consumers are required to send an HTTP GET request to the /api/ipn/products endpoint. This endpoint requires the security token, obtained during the Authentication process on the API, as an integral component of the JSON payload within the body of the request. Additionally, should there be a necessity to filter products by professions, an optional attribute, professionId, can be included as a HTTP GET parameter.
Action name | get products |
---|---|
HTTP path | /api/ipn/products |
HTTP method | GET |
Attributes of the HTTP request
HTTP Request Header | |||
---|---|---|---|
Authorization | string | required | A security token provided from Authentication endpoint. |
HTTP GET parameter | |||
professionId | int | optional | An attribute used to filter out all products for particular profession. |
Attributes of the HTTP response
Success response | |||
---|---|---|---|
JSON array of objects containing: | |||
id | int | required | An unique identifier of the product. |
name | string | required | A product’s name. |
Failed response | |||
error | string | required | It contains a reason for the failed request. |
Examples
This section shows examples of different HTTP requests and responses associated with the endpoint /api/ipn/products.
HTTP Request without profession filter |
# HTTP GET # https://ipn.dev.thinksurance.de/api/ipn/products # # HTTP headers # 'Accept': 'application/json' # 'Authorization': 'Bearer <some long string value>' # |
HTTP Request with profession filter |
# HTTP GET # https://ipn.dev.thinksurance.de/api/ipn/products?professionId=123 # # HTTP headers # 'Accept': 'application/json' # 'Authorization': 'Bearer <some long string value>' # |
Successful HTTP Response |
# HTTP 200 status code # 'Content-Type': 'application/json' [ { "id": 1, "name": "Product1" }, { "id": 2, "name": "Product2" } ] |
Failed HTTP Response |
# HTTP 200 status code # 'Content-Type': 'application/json' { "error": "API User is not existing or deactivated." } |