Create a Simulated Alarm
Simulated alarms allow partners to create their own alarms that function like regular system generated alarms. This allows partners to thoroughly assess and optimize their integration, ensuring accurate detection and response to actual alarms. Users may perform all operations on the simulated alarm, as if it was a regular system generated alarm. For more information about alarms, see Alarms.
When a simulated alarm is created, it is displayed in alarm reports and API responses, as well as email and webhook notifications. A simulated alarm appears identical to a regular system generated alarm, except it also contains a customer comment to support the test process.
The rest of this guide shows you how to use the Surfsight API to create a simulated alarm, following these steps: check
Note
For more information about the different API requests, take a look at our reference guide.
1. Authenticate yourself
Authenticate yourself before making any calls with the Surfsight API. For more details on authentication, see our authentication overview.
2. Create a simulated alarm
Create a simulated alarm with the POST /devices/{imei}/alarm-simulator
call.
curl --location 'https://localhost:33003/v2/devices/888888/alarm-simulator'\
--header 'Content-Type: application/json' \
--header 'Authorization: Bearer ?' \
--data '{
"alarmDefinitionId": 133,
"createdAt": "2023-12-05T08:20:22Z",
"metadata": "hello hello"
}
Parameter | Description | Example |
---|---|---|
imei | The IMEI of the device. The IMEI number can be found on a sticker on the device itself or on the back of the device box. | 357660101000198 |
alarmDefinitionId | The ID of the alarm definition. This determines the type of alarm that is simulated. | 133 |
createdAt | The time the alarm is created, in ISO format. | 2023-12-05T08:20:22Z |
metadata | Additional text about the alarm, as a string. The information is displayed as a comment to the alarm. This parameter is optional. | hello hello |
Note
It is impossible to create a simulated alarm with the same parameter values for imei
, alarmDefinitionId
, and createdAt
as another alarm. This is true even if the original alarm is closed. The values for the imei
, alarmDefinitionId
, and createdAt
parameters must be unique to each simulated alarm.
3. Retrieve alarm details
Retrieve alarm details with the GET /alarms/{alarmId}
API call.
curl -i -X GET \ https://api-prod.surfsight.net/v2/alarms/:alarmId \
-H 'Authorization: Bearer <YOUR_TOKEN_HERE>'
Parameter | Description | Example |
---|---|---|
alarmID | The ID of the alarm. Obtain this from the GET /alarms API call. For more information see Retrieve alarms report. |
133 |
The returned response.
{
"data": {
"id": 625,
"details": "cyclic_recorder_status: 4, last_video_record_time: 1600683797",
"organizationId": 17,
"organizationName": "Company Name",
"partnerId": 1,
"partnerName": "James",
"userId": 32,
"alarmDefinitionId": 133,
"createdAt": "2019-08-24T14:15:22Z",
"lastReadAt": "2019-08-24T14:15:22Z",
"lastCloseAt": "2019-08-24T14:15:22Z",
"comments": [
{
"details": "comment about the alarm",
"id": 34,
"alarmId": 133,
"createdByAudienceName": "surfsight",
"createdById": 9,
"createdAt": "2019-08-24T14:15:22Z",
"commentorName": "Commentor name"
}
],
"actions": [
{
"type": "open",
"id": 125,
"alarmId": 133,
"createdByAudienceName": "surfsight",
"createdById": 625,
"createdAt": "2019-08-24T14:15:22Z"
}
]
}
}