Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: Reverted from v. 2

...

To retrieve products, consumers are required to send an HTTP GET POST 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 parameterpart of the JSON payload.

Action name

get products

HTTP path

/api/ipn/products

HTTP method

GETPOST

Attributes of the HTTP request

HTTP Request Header

Authorizationtoken

string

required

A security token provided from Authentication endpoint.Required to provide as a Bearer Token (in format: “Bearer {{token}}“).

HTTP GET parameter

professionId

int

optional

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

...

This section shows examples of different HTTP requests and responses associated with the endpoint /api/ipn/products.

HTTP Request without profession filter

json
Code Block
language
# HTTP GETPOST
# https://ipn.dev.thinksurance.de/api/ipn/products
# # HTTP headers
'Content-Type': 'application/json'
# 'Accept': 'application/json'
{
# 'Authorization': 'Bearer <some  "token": "some long string value>'
# value"
}

HTTP Request with profession filter

language
Code Block
json
# HTTP GETPOST
# https://ipn.dev.thinksurance.de/api/ipn/products?professionId=123
# # HTTP headers'Content-Type': 'application/json'
# 'Accept': 'application/json'
{
 # 'Authorization' "token": 'Bearer"some <some long string value>'
# value",
  "professionId": 123
}

Successful HTTP Response

language
Code Block
json
# HTTP 200 status code
# 'Content-Type': 'application/json'
[
  {
    "id": 1,
    "name": "Product1"
  },
  {
    "id": 2,
    "name": "Product2"
  }
]

Failed HTTP Response

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