Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Table of Contents

Introduction

To obtain the payload of a specific document, the Thinksurance Public API V1, denoted as "the API," offers a specialised endpoint. This endpoint allows consumers to retrieve a document by its identifier (hash) and acquire its complete payload as a base64-encoded data.

Endpoint

To access the specific document, consumers must initiate an HTTP POST request to the /api/doc/get/{:token} endpoint. The token parameter represents the security token acquired during the Authentication process on the API. As essential components of the JSON payload within the body of the request, consumers are required to include the hash (serving as the document identifier) and bToken (functioning as the broker identifier).

Action name

get productsdocument

HTTP path

/api/doc/get/{:token}

HTTP method

POST

...

An attribute that contains document’s content, in base64 format

Success response

JSON array of objects containing:

pdfbinary

string

required

Base64 encoded content of the document.

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/doc/get/{:token}.

HTTP Request without profession filter

Code Block
# HTTP POST
# /api/doc/get/{:token}
# 'Content-Type': 'application/json'
# 'Accept': 'application/json'
{
  "hash": "some encrypted string",
  "bToken": "some encrypted string"
}

HTTP Request with profession filter

Code Block
# HTTP POST
# /api//doc/get/{token}
# 'Content-Type': 'application/json'
# 'Accept': 'application/json'
{
  "token": "some long string value",
  "professionId": 123
}

Successful HTTP Response

Code Block
# HTTP 200 status code
# 'Content-Type': 'applicationtext/jsonpdf'
{Base64   "pdfbinary": "a long hashed string"
}encoded payload

Failed HTTP Response

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