Event endpoints
Get a list of events
Section titled Get a list of eventsPOST /v1/speed-analysis/event/list
Returns the list of events.
Parameters
-
key string
Key of the event.
-
dateFrom ISO 8601 date string
Retrieve events executed after this date.
ISO format in UTC (for example “2021-08-13T12:32:40.000Z”) or with a time zone offset (“2021-08-13T12:32:40+02:00” or “2021-08-13T12:32:40%2B+02:00” when encoded in the URL).
-
monitoringId number
Unique identifier of a monitoring. It can used to get events for a specific monitoring.
-
scenarioId number
Unique identifier of a scenario. It can used to get events for a specific scenario.
Request example
curl --location --request GET 'https://api.contentsquare.com/v1/speed-analysis/event/list' \--header 'Authorization: Bearer <your_access_token>'--data '{ "key": ""}'
Response example
{ "payload": { "events": [ { "key": "", "text": "", "date": "2016-10-07T12:00:00.000+02:00" } ] }, "success": true}
Create an event
Section titled Create an eventPOST /v1/speed-analysis/event/create
Returns the created event.
Parameters
-
key string Required
Key of the event.
-
text string Required
Text of the event.
-
date ISO 8601 date string Required
Date of the event.
ISO format in UTC (for example “2021-08-13T12:32:40.000Z”) or with a time zone offset (“2021-08-13T12:32:40+02:00” or “2021-08-13T12:32:40%2B+02:00” when encoded in the URL).
-
monitorings number[]
List of monitoring identifiers that can be retrieved from the monitoring list (
/monitoring/list
). It can be used to associate the event with multiple monitorings. -
scenarios number[]
List of scenario identifiers that can be retrieved from the scenario list (
/scenario/list
). It can be used to associate the event with multiple scenarios.
Request example
curl --location --request GET 'https://api.contentsquare.com/v1/speed-analysis/event/create' \--header 'Authorization: Bearer <your_access_token>'--data '{ "key":"", "text": "", "date": "", "monitorings":[0]}'
Response example
{ "payload": { "key": "" }, "success": true}
Delete an event
Section titled Delete an eventPOST /v1/speed-analysis/event/delete
Returns the deleted event.
Parameters
-
key string Required
Key of the event.
Request example
curl --location --request GET 'https://api.contentsquare.com/v1/speed-analysis/event/create' \--header 'Authorization: Bearer <your_access_token>'--data '{ "key":""}'
Response example
{ "payload": { "key": "" }, "success": true}