Message IDs

When using the SessionM S2S APIs, it is strongly recommended that the client provide a unique Message ID with each request, as follows:

Copy
Example HTTP Request Header

GET /path/to/api/endpoint HTTP/1.1
Content-Type: application/json
Message-ID: de305d54-75b4-431b-adb2-eb6b9e546014
            

Doing so allows a simple way to track messages and also provides a means for supporting idempotent requests. When a request is sent with a Message ID in its HTTP header, that ID becomes associated with the request. It is included in the HTTP header of the accompanying response and can be used to uniquely identify a message within the SessionM Platform.

A request that is sent with a Message ID lists the message processing date in its response. Also, subsequent requests for the same Message ID made within 30 minutes of the original causes a cached response to be re-sent without producing any new changes in state. Replayed requests like this are marked by the 'Cached-Message' header being set to 'true' in the response, as shown below:

Copy
Example HTTP Response Header (Existing Message)

HTTP/1.1 200 OK
Content-Type: application/json
...
Message-Id: de305d54-75b4-431b-adb2-eb6b9e546014
Message-Date: Mon, 28 Sep 2015 03:04:15 GMT
Cached-Message: true