Set and retrieve a timestamp
Set and retrieve a timestamp
This is for:
DeveloperThe Qubit Timestamp API allows a timestamp to be set on an action, and then retrieved later.
Client-specific values
Before using the Timestamp API, you will require the following unique values:
Name | Description |
---|---|
|
CEH tracking ID for the property the request is made from. This will be provided by your Customer Success manager at Coveo. |
|
Unique site visitor ID, generated by the Smartserve script on the page and is set in the cookies qb_permanent and qbTracker. |
Setting a Timestamp
Setting a timestamp is done via sending a POST
request to the endpoint with the name of the timestamp.
When this is made, the current UNIX timestamp is saved.
POST stash.qubitproducts.com/stash/v1.1/ts/set/<tracking_id>/public/<visitor_id>:<timestamp_name>
The value of <timestamp_name>
must be a URL friendly string.
If the timestamp exists, the response will be as below, where <value>
is the UNIX timestamp stored.
If the timestamp does not exist, then the status code will be 404
.
{
status: 200,
data: "<value>"
}
Retrieving a Timestamp
Retrieving a timestamp back is done via a GET
request with the name of the timestamp.
GET stash.qubitproducts.com/stash/v1.1/ts/get/<tracking_id>/public/<visitor_id>:<timestamp_name>
Response Codes
Each response message contains a response code, which indicates the status of the original query. The format of the response will be JSON such as the below:
{ status: 200 }
This response code can be checked to quickly determine whether a query was successful or a retry needs to be made. Note that this is not related to the actual HTTP response code, which will always be 200.
Code | Description |
---|---|
200 |
The operation completed successfully |
400 |
The operation did not complete due to a client side error. This code will be returned when the request parameters had invalid values |
404 |
The operation did not complete due to a client side error. This will be returned when the requested key or keys are not found |
500 |
The operation could not be completed due to a server side error. A retry needs to be made in this case |