Creating a New Analytics Event

Hello,

I attempted to create a new Analytics Event in Milestone XProtect VMS using the following POST request in JSON format:

POST /analyticsEvents

{

“name”: “MyAnalyticsEvent”,

“description”: “AnalyticsEvent may have a long description”,

“relations”: {

“self”: {

**"type": "analyticsEvents",**

**"id": "a03af6dd-262b-431c-864a-e92e567248e2"**

}

}

}

However, when I send this request, I receive a “400 Bad Request” error. I’m unable to understand the reason for this error and unable to successfully create or update the Analytics Event.

Could you please assist me? Could you review if I structured the request correctly or suggest another method for creating and updating an Analytics Event?

Thank you

I cannot reproduce, for me it works..

https://doc.developer.milestonesys.com/mipvmsapi/api/config-rest/v1/#tag/Events/operation/postanalyticsEventsById

If you do a GET, do you get a good response or the same error?

What product and version is the XProtect VMS?

Thank you for your response. I tried to create a new analytics event for XProtect located at the address 192.168.1.22, following the steps shown in the visuals, but I’m currently receiving a 401 Unauthorized error. I’m unsure of why this issue is occurring and how to resolve it. Is there another parameter that needs to be added to the header of this request ?

I suspect you don’t have a token, please start here. https://doc.developer.milestonesys.com/mipvmsapi/content/quickstart/