Alarms and Analytics events trigger through Rest API

Hello !

Despite closely following the API documentation, I keep receiving Bad Request errors when trying to trigger alarms and analytics events through the REST API.

I have tested with both Express 2023 R3 and Express 2024 R1. Could the error come from the Express version ?

Authentication and token configuration has correctly been done as I can, for example, request the list of cameras.

Here’s a recap of my requests:

POST /alarms

```

{

“name”: “Test alarm”, # Alarm name retrieved from the GET /alarms. This alarm indeed exists

“message”: “this is a test”,

“source”: “cameras/<CAMERA_GUID>”

}

```

POST /analyticsEvents

```

{

“type”: “<ANALYTICS_EVENT_GUID>”, # id field from the GET /analyticsEvents. Not sure if this corresponds to a ‘type’ though

“source”: “cameras/<CAMERA_GUID>”,

“datatype”: “analytics”

}

```

  • Is there an issue with these payloads ?
  • Why does the /alarms endpoint expects a name rather than an alarm guid ?
  • Is there any way to trigger an alarm without linking it to an Alarm Definition ? As it is possible with the Soap integration

Many thanks for your help

Express+ should be fine.

I did a quick test with the “POST alarms” and it works for me.

Note that alarm does not need to exist, I am not sure why you mention it.

What is the error you see?

The error I receive is just a 400 with “Bad request”, no more details.

Good to know that the alarm does not need to exist. Since it is stated as required, it seemed that it needed to exist.

I just tested against Professional 2024 R1, same issue.

Ok I found the error, it comes from my hand, as the JSON serialization was making a mistake. Sorry about that