Scenes Input
Route for sending a scene data to Trax
API endpoint for submitting Scene information as part of Visit Data
PUT /api/:version_number/:project_name/session/:session_uid/scenes/:scene_uid
curl -K -H "Authorization: Auth-Token YOUR_PROJECT-API-KEY" -X PUT https://services.traxretail.com/api/v4/my-project/sessions/my-session-UID/scenes/my-scene-UID
Supported Protocol: HTTPS
PUT
Request Headers
Authorization string
Value: 'Auth-Token {project auth token}'
Authentication token provided by Trax
Query Parameters
version_number string *
The current implemented API version. <Major> version (e.g. 'v4')
project_name string *
Project name as provided by Trax
session_uid string *
UUID generated by the client for the session.
The session UID will be generated at the beginning of the Session and will be used throughout the session
scene_uid string *
UUID generated by the client for the scene.
The scene UID will be generated at the beginning of the scene and will be used when sending Images of this scene
Request Details
Mandatory fields marked indicated by
*
client_session_uid string (100)
Identifier provided by the client for the session.
This value is not checked for uniqueness by Trax, and can be used to map the session object in the Analysis Results
store_number string (100) *
Client's Store unique identifier, as provided in Stores
visit_date string (YYYY-MM-DD)*
The date of the visit by local time zone
task_code string *
Task code that has been configured in coordination with the Trax implementation team
area_id number
Identifier for the store area in Trax system. It has been configured in coordination with the Trax implementation team
email_address string (255)
The email of the user conduction the session.
If this value is provided, it must correlate to an email address of a user as sent in Users (V4 or V5)
aisle_number string
Aisle related information
images Object[] *
List of images containing the following values:
image_uid string (100)*
UUID generated by the client for the image
image_capture_time number (Epoch Unix Time timestamp) *
Unix Epoch Timestamp of the image capture time. The time should correspond to the capture time sent in Images
Request Body
Mandatory fields marked indicated by
*
Request Body Example
{
"client_session_uid": "My_session_uid",
"store_number": "100050000000008",
"visit_date": "2017-06-02",
"task_code": "123",
"area_id": 7,
"email_address": "john@example.com",
"images": [
{
"image_uid":"5c176511-22fe-4daf-b68e-cd383c056f96",
"image_capture_time": 1496834786
},
{
"image_uid":"9b7488f9-067c-4f7a-909d-4dd310978fcf",
"image_capture_time": 1496834786
},
{
"image_uid":"e4f6f8ad-1ca9-4f96-86fe-5f5df70a4ed2",
"image_capture_time": 1496834786
},
{
"image_uid":"ba0f6b22-7f4e-4ea5-9084-f30bc0ceaef7",
"image_capture_time": 1496834786
},
{
"image_uid":"ab4e84d3-94cd-47c4-9f36-c10fa81f4ba1",
"image_capture_time": 1496834786
}
]
}
Validation and Errors
When uploading the Scene, the Trax system runs numerous validations on the file to confirm it has all the necessary fields.
Should there be issues with the upload, an error code and error will be returned. It will contain one the following errors based on failing the related validation:
Scene already received
-
Error Code: 409 - Conflict
-
Error: This request has already been handled
Mandatory Variables
-
Error Code: 400 - Bad Request
-
Error:
Missing mandatory field - <field_name>
OR
Missing mandatory fields - <field_name>,<field_name>...
Variable Types
-
Error Code: 400 - Bad Request
-
Error:
missing mandatory field - <field_name>
OR
missing mandatory fields - <field_name>,<field_name>...
Unknown Scene Type code/Id
-
Error Code: 400 - Bad Request
-
Error: Unknown task id
Unknown Store
-
Error Code: 400 - Bad Request
-
Error: Unknown Store <request_store_identifier_>
Lookup Value does not exist
-
Error Code: 400 - Bad Request
-
Error: Lookup value does not exist: <lookup_value>
Incorrect Format
-
Error Code: 400 - Bad Request
-
Error:
Incorrect format field: <field_name>,
the correct format: <correct_format>
Internal Server Error
-
Error Code: 500 - Internal Sever Error
-
Error: Trax Internal Error
Incorrect or expired token
-
Error Code: 401 - Unauthorized
-
Error: Incorrect or expired token
Requesting a forbidden resource
-
Error Code: 403 - Forbidden
-
Error: A forbidden resource has been requested <resource>