Hi, I am planning to create an event with API : https://localhost:443/api/rest/v1/events.
with a user defined event name through this API : https://localhost:443/api/rest/v1/userDefinedEvents .
However I don’t see any documentation how to create user defined payload and associate to that userDefinedEvent.
something similar to :
{
"type": "7666d573-8634-42e4-9738-42c11f67cb72",
"source": "cameras/f82ee791-ed78-41ac-9304-ce4947ba1e8f",
"time": "2009-02-15T00:00:00.0000000Z",
"datatype": "UserDefined",
"data": {
“user_defined_field1”: “string”,
“user_defined_field2”: “string”,
“user_defined_field3”: “float”,
}
}
So where to define this payload for that user defined datatype ?
@Naresh Anga right now, custom payloads are not accepted in user defined events.
First, `“datatype”: “UserDefined”,` is not a documented or supported datatype. In the docs you will see that in R2 only none and analytics are supported.
User-defined events won’t support payloads in coming releases either. We are working on improving support for user-defined events but cannot commit to anything yet.
If you need to attach a custom payload / data to the event, you have two options:
- use either datatype analytics with an analytics event (not a user defined one)
- use datatype freeform with any kind of event type (including plugin event types defined in EVS plugins), which will be available in 23R3
Remember Events REST API is in beta.
Thank you for your quick response