Assurance API Endpoint | Developers Integration Guide
← Setup Guide
Who is this article for?Developers who want guidance on integrating with the Assurance API endpoint.
Administration Access is required.
Our API Endpoints are a uniform resource locator (URL) that provide the location of a resource on our servers.
1. Sample JSON payload
POST /api/v1/contracts
{
"template_id": 0,
"tenant": "Your tenant name",
"name": "Your form/register name",
"owner": "Email of the person responsible",
"fields": {
"Field name": "Field value"
}
}
Returns
{ status: 200 , contract_id: 29239 }
Major differences and points are:
- You need to know template_id
- Field name will be used, instead of id
- The header will be an API key, which can be setup via administration section in your Assurance site
- Each call to the endpoint requires an access token which is only for 24hrs
2. Sample curl example
curl -X POST
-H "accept: application/json"
-H "X-Api-Key: organisation-api-key" -H "Authentication: access-bearer-token"
-H "Content-Type: application/json"
-d "{ \"template_id\": 0, \"tenant\": \"Your tenant name\", \"name\": \"Your contract name\", \"owner\": \"Email of the contract owner\", \"fields\": { \"Field name\": \"Field value\" }}"
Important note
The v1 endpoint for Assurance reports is deprecated as of 1 December 2023. While it will continue to work through the new year, we strongly encourage anyone using the Assurance API reports to adopt the v2 version of the endpoint. (Just substitute 'v2' for 'v1' in the URL - everything else is identical.) The reason for this is that the v1 endpoint can hit certain internal limits when it comes to returning large amounts of data. The v2 version does not have that restriction - although, for really large datasets, we would encourage users to adopt the cache/snapshot strategy detailed in this guide.
You will notice the following changes:
- When using the Swagger-UI frontend, the v1 endpoint is greyed out (although still usable)
- Requests to the v1 version will now return a Deprecated HTTP header in the API response.