V2 Download documents and submit Error message

Introduction

To download a specific document, the Thinksurance Public API V2, denoted as "the API," offers a specialised endpoint. This endpoint allows consumers to retrieve documents. The full base URL is depends on environment and it’s listed V2 API main page .

Endpoint

To access the specific document, consumers must initiate an HTTP GET request to the API endpoint /api/public/v2/notifications/{:notification_id}/documents/{:document_id}. It is critical to use the API endpoint that is provided by Notification webhook. The authentication is done via a bearer token which can be received during Authentication process V2 Authentication and needs to be sent in authorization header.

Action name

get content of document

HTTP path

/api/public/v2/notifications/{:notification_id}/documents/{:document_id}

  • notification_id - unique identifier of the notification

  • document_id - unique identifier of the document

HTTP method

GET

Attributes of the HTTP request

HTTP Request Header

HTTP Request Header

Authorization

string

required

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

HTTP response

Success HTTP Response

Returns content of the document with headers:

# HTTP 200 status code content-disposition: attachment; filename=<filename> content-length: <file size> content-type: <MIME type>

Failed HTTP Response

# HTTP 404 status code # 'Content-Type': 'application/json' { "error": "error message" }

Failed response

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.

HTTP Request

# HTTP GET # /api/public/v2/notifications/{{notificationId}}/documents/{{documentId}} # 'Content-Type': 'application/json' header 'Authorization: Bearer {{access_token}}

Successful HTTP Response

Failed HTTP Response

Document Error Endpoint

For any errors that might be encountered on with the document, the following endpoint can be used to collect them /api/public/v2/notifications/{:notification_id}/documents/{:document_id}/errors

Action name

send document errors

HTTP path

/api/public/v2/notifications/{:notification_id}/documents/{:document_id}/errors

  • notification_id - unique identifier of the notification

  • document_id - unique identifier of the document

HTTP method

POST

HTTP body

Attributes of the HTTP request

HTTP Request Header

HTTP Request Header

Authorization

string

required

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

HTTP response

Success response

Success response

Status

200

Body

Examples

This section shows examples of different HTTP requests and responses associated with the endpoint.

HTTP Request

Successful HTTP Response