Request ID header

Find a specific API call when you ask us for help.

Every response from the Phorest API includes an X-Request-Id header, apart from a few cases listed at the end of this page. Its value is a unique ID for that one call:

HTTP/1.1 200 OK
Content-Type: application/json
X-Request-Id: 3f9c2a1e-7b4d-4c8e-9a2f-5d6e8b1c0a47

Header names aren't case-sensitive, so your HTTP client may show it as x-request-id.

Why it's useful

When you contact us about a specific call, such as an unexpected error, a slow response or data that doesn't look right, send us its request ID. With it we can find that exact call: when it reached us, which endpoint it called and what we returned. Without it, we have to search by time and endpoint, which is slower and not always conclusive.

What to do in your integration

  • Log the X-Request-Id of every call, or at least of every call that fails, together with the time and the endpoint.
  • When you contact [email protected] about a call, include:
    • the request ID,
    • the server you called (api-gateway-eu.phorest.com or api-gateway-us.phorest.com),
    • the approximate time of the call, in UTC.
📘

A new ID for every call

We create a new ID for every call, retries included. If you send an X-Request-Id header in your request, we ignore it.

Error responses

Error responses also carry an id in the body:

{
  "statusCode": 404,
  "id": "b7e2c9d4-1f3a-4e6b-8c5d-2a9f7e1b3c60",
  "detail": "The requested resource could not be found."
}

This id is different from the request ID, but either one lets us find the call. Successful calls only have the request ID, so that's the one to log.

When there's no request ID

Some responses don't include the header, because the request was turned away before it reached the API. For example:

  • 401 Unauthorized: the username or password is missing or wrong.
  • 429 Too Many Requests: you've gone over the rate limit.
  • Some 502, 503 or 504 responses: the API couldn't be reached or didn't answer in time.

For these, send us the time of the call (in UTC), the endpoint and your API username instead.


Did this page help you?