Skip to content

Your first API call ​

This tutorial takes one request apart, so you can tell a working integration from a broken one by reading the response alone.

The request ​

bash
curl -i https://api.essence.digital/api/v1/vaults \
  -H "Authorization: Bearer $ESSENCE_ACCESS_TOKEN"
  • https://api.essence.digital is the API origin. Every path is versioned: /api/v1/….
  • Authorization: Bearer … carries your access token (see Authentication). Without it, every protected path answers 401.

Reading the response headers ​

These headers come back on every response, success or failure:

HeaderExampleWhat it tells you
x-correlation-id7234a82d-f665-4c67-b4a0-cfd5f9c09f5fThe ID of this request across every service it touched. Quote it when you contact support
x-ratelimit-limit100Requests allowed in the current window
x-ratelimit-remaining99Requests left in the window
x-ratelimit-reset1790370832When the window resets, in Unix seconds

When x-ratelimit-remaining reaches 0, further requests get 429 Too Many Requests until the reset time. Back off until then rather than retrying at once.

Telling the failures apart ​

StatusBodyMeaningWhat to do
401empty, with WWW-Authenticate: BearerNo token, or the token is invalid or expiredSend a valid token, or refresh it
403problem documentYour token is valid but may not do thisCheck the permissions granted to the token
404problem document or emptyNo such path, or no such resourceCheck the version segment and the ID
400problem document with validationErrorsThe request body failed validationFix the fields it names
429problem documentRate limit reachedWait for x-ratelimit-reset

A 401 and a 404 are how you tell a wrong address from missing credentials. An unknown path such as /api/v1/no-such-thing answers 404 even without a token. A real path without a token answers 401.

Problem documents ​

Errors from the services are RFC 7807 problem documents, served as application/problem+json. A validation failure looks like this:

json
{
  "type": "https://essence.digital/errors/400",
  "title": "Validation Failed",
  "status": 400,
  "detail": "One or more validation errors occurred.",
  "correlationId": "4be6c4f4-a89e-4df1-99f9-5582dbffe977",
  "serviceName": "auth-service",
  "instanceId": "global",
  "validationErrors": {
    "DeviceFingerprint": ["Device fingerprint is required"]
  }
}

Branch on status and type, never on title or detail: the human-readable text can change and is localised. validationErrors maps each rejected field to the reasons it was rejected. The full list of problem types is in Error codes.

Next ​

Built with ❤️ for developers · Service status