Nonces
In DNAnexus, a nonce is a string that uniquely identifies a request against the DNAnexus API. Using a nonce ensures that regardless of how many times a request is made, the result remains the same as a single successful request. This is particularly useful for handling network failures. If a response is dropped on its way back to the client, the client can reissue the request with the nonce, and DNAnexus API recognizes it as a previous request and returns an exact replica of the dropped response.
The nonce field is used primarily in routes for project, data object, and job creation. Using a nonce with these routes prevents a client from accidentally creating multiple items when only one is intended. The routes are as follows:
As a nonce is a unique identifier of a request, the input used in a request must remain unchanged when retrying with a nonce. If any change is made to the input, the API considers it a separate and different request and throws an InvalidInput error. The nonce field must not exceed 128 bytes in a UTF-8 encoded string.
Nonces are designed for recovery and retry of dropped requests within a short time period. This behavior is guaranteed only for second requests made within one hour of the original request. After one hour, the second request may create a new object (as if no nonce was supplied).
Last updated
Was this helpful?