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.