Skip to main content

Data Health & Insights API

Updated over a week ago

Dext Data Health & Insights offers a RESTful API to extract basic data contained within your Dext account. If you would like to use the API, we would recommend that your team get in touch.


Getting Started

The current version of the API lives at https://api.precision.dext.com/

The easiest way to start using our API is by finding an HTTP client online. We would recommend using Postman, or Paw as they are ready-to-use, free tools.

In our demo we are going to use Postman.

Endpoints Summary


Endpoint

What it does

/clients

Returns a list of Clients

/clients/{clientId}

Returns details of a specific Client

/clients/{clientId}/activity-stats

Returns Activity Stats metrics for a specific Client


Authentication

In order to get data out, you must pass an authorization token in the request header:

Request Header: Authorization: Bearer <your token>

To generate a token please use the following instructions:

In Dext head to Practice Settings, then Data Health and API Tokens. Then enter the name of the token and click Create to generate your token.

Migrated image content

WARNING: Store the token securely and do not share it with anyone else.

For example, to use your token in Postman, select bearer token as your authentication method and copy your given token into the correct field. See below:

postman.png


Rate Limits

A rate limit restricts the number of API requests a consumer can make within a given time period. If this limit is exceeded the consumer will be throttled and API requests will fail.
Dext Rate Limits are set to 60 requests/minute.

If you exceed your rate limit allowance your request will be rejected. An HTTP 429 (Too Many Requests) response will be returned.

Dext returns rate limit details in the header of API responses to allow consumers to monitor their API usage.

Example response header:

Key

Value

Date

Thu, 30 Jan 2020 16:27:15 GMT

Content-Type

application/json

Connection

keep-alive

Server

cloudflare

X-RateLimit-Limit

60

X-RateLimit-Remaining

42


Response Codes

200 - OK

A 200 status code indicates that the request was accepted and processed successfully.

404 - Not found

A 404 error status code indicates that the API can't map the requested URI to a resource.

429 - Too many requests

A 429 error status code is returned when an API consumer hits our rate limits.

500 - Internal Server Error

A 500 error status code is a generic API server-side error response. Please contact our support team if this persists.


API Endpoints


GET /clients

The /clients endpoint returns a list of all Dext clients that the given authentication token has access to, in a summarised format.

Request: https://api.precision.dext.com/clients

Response Content Type: application/JSON

Response Model:

[
    {
        "id": "string",
        "name": "string",
        "practiceCode": "string",
        "providerId": "string",
        "healthScore": integer,
        "alertLevel": "string"
    }
]

Example value:

example value.png


GET /clients/{clientId}

The /clients/{clientId} endpoint returns a detailed set of information about a particular client identified by the clientId, including some calculated metrics.

Request: https://api.precision.dext.com/clients/{clientId}

Response Content Type: application/JSON

Response Model:

{
    "id": "string",
    "name": "string",
    "providerId": "string",
    "practiceCode": "string",
    "organisationType": "string",
    "companyNumber": "string",
    "healthScore": integer,
    "alertLevel": "string",
    "hmrcStatus": "string",
    "yearEnd": "string",
    "vatDetails": {
        "scheme": "string",
        "number": "string",
        "reportingCycle": "string",
        "periodStart": "string",
        "periodEnd": "string"
    },
    "metrics": {
        "debtorBalance": float,
        "avgDebtorDays": integer,
        "oneDayImpact": float,
    },
    "bankReconciliation" : {
        "bankAccounts": integer,
        "manualFeeds": integer
    }
}

Example value:

example value2.png


GET /clients/{clientId}/activity-stats

The /clients/{clientId}/activity-stats endpoint returns the rolling annual and monthly-average Activity Stats for a particular client, identified by the clientId.

Request: https://api.precision.dext.com/clients/{clientId}/activity-stats

Response Content Type: application/JSON

Response Model:

{
    "annual": {
        "start": "string",
        "end": "string",
        "turnover": float,
        "salesCount": integer,
        "billsCount": integer,
        "creditsCount": integer,
        "manualJournalsCount": integer,
        "bankTransactionsCount": integer,
        "totalCount": integer,
        "turnoverChangeYoY": integer,
        "salesChangeYoY": integer,
        "billsChangeYoY": integer,
        "creditsChangeYoY": integer,
        "manualJournalsChangeYoY": integer,
        "bankTransactionsChangeYoY": integer,
        "totalChangeYoY": integer
    },
    "monthlyAverage": {
        "start": "string",
        "end": "string",
        "turnover": float,
        "salesCount": integer,
        "billsCount": integer,
        "creditsCount": integer,
        "manualJournalsCount": integer,
        "bankTransactionsCount": integer,
        "totalCount": integer,
        "turnoverChangeYoY": integer,
        "salesChangeYoY": integer,
        "billsChangeYoY": integer,
        "creditsChangeYoY": integer,
        "manualJournalsChangeYoY": integer,
        "bankTransactionsChangeYoY": integer,
        "totalChangeYoY": integer
    },
    "quarterlyAverage": {
        "start": "string",
        "end": "string",
        "turnover": float,
        "salesCount": integer,
        "billsCount": integer,
        "creditsCount": integer,
        "manualJournalsCount": integer,
        "bankTransactionsCount": integer,
        "totalCount": integer,
        "turnoverChangeMoM": integer,
        "salesChangeMoM": integer,
        "billsChangeMoM": integer,
        "creditsChangeMoM": integer,
        "manualJournalsChangeMoM": integer,
        "bankTransactionsChangeMoM": integer,
        "totalChangeMoM": integer,
        "turnoverChangeYoY": integer,
        "salesChangeYoY": integer,
        "billsChangeYoY": integer,
        "creditsChangeYoY": integer,
        "manualJournalsChangeYoY": integer,
        "bankTransactionsChangeYoY": integer,
        "totalChangeYoY": integer
    }
}

Example value:

example value3.png

Did this answer your question?