This ensures that each POST request is processed exactly once by our API. Uniquely identifying POST requests that create new resources is particularly crucial when the response outcome is uncertain due to temporary service disruptions, such as server timeouts or network failures.
In such cases, the client application can safely retry the request without the risk of duplicate operations.
API endpoints that guarantee a request is processed only once, regardless of how many times it is retried with the same unique identifier, are referred to as idempotent.
How to use it?
Include in your request to Chift, the following header:x-chift-client-requestid: 123456
The value (123456 in this example) is a unique identifier that you generate and manage on your side:
- Format and storage: It must be a varchar(255), meaning it can contain up to 255 characters. You are responsible for generating it in a way that guarantees uniqueness for each request.
- Scope and usage: The header is not tied to a specific endpoint and can be included in any request. Each value must be unique per request, regardless of the endpoint, to ensure duplicates are correctly detected.
- Chift keeps logs of these identifiers for 6 months.
What can you expect?
You can expect a 409 error code in case you request was processed (REQUEST_ALREADY_PROCESSED) or currently in processing (REQUEST_IN_PROCESS): E.g.Monitoring
The transaction endpoint (API Reference ↗️ ) allows you to retrieve detailed information about any API transaction using thex-chift-client-requestid. This is particularly useful for auditing, troubleshooting, or tracking the status of a request.
For POST endpoints, the response also returns the created_entity_id, giving you the identifier of the newly created entity directly in the monitoring response.
Key Points:
- This endpoint is ideal for monitoring asynchronous or long-running operations, providing a single source of truth for the status and result of any request.
- If you decide to implement a timeout on your requests—for example, terminating the connection after 30 seconds or 1 minute—Transaction Monitoring allows you to track the outcome of requests that continue executing on Chift even after your timeout has cut the connection.
- The monitoring endpoint works across all connectors.