Send custom data to a generic event

Hi

My end goal is to trigger an event in Milestone from our application (OutWatch). Our application gets incoming alarms from multiple cameras that includes images/video. I want to trigger an alarm in Milestone and include the images/videos URLs so that they will be displayed (or at least show as links to the operator so he can click them to see)

so I created under “genric events” a new “AlertFromOutWatch”

I then called GET http://sensodev/api/rest/v1/eventtypes, found the above item (for some reason in the response json it appeared under “user defined events”).

then I sent this:

POST http://sensodev/api/rest/v1/events with the proper authorization header

With this body:

{

“type”: “93418786-63c7-44b4-9e5c-0c45cbdae13d”, – this is from the prev GET call

“source”: “UserDefinedEvent”, – here i tried null/nothing/empty string

“data”: {

“snapshots”: [

https://sensoguard-trailcam-images.s3.eu-west-1.amazonaws.com/1/1/0A2D7C1A-6283-412B-89B8-FC88272C4220.jpg”,

https://sensoguard-trailcam-images.s3.eu-west-1.amazonaws.com/1/1/0A6A0159-5A3B-40EA-8155-F4D7AF771186.jpg

]

}

}

I get “unknown source…”, or “A source is required for the given event type"

I understand this is supposed to be a camera id – but I am not a camera – I am an external event trigger

This is where I am stuck right now.

Generic event have a special purpose, for what you are doing make sure to use user-defined events.

Hi

thank you for your answer -

if so, how do I send my image/video URLs? (the docs state that "User defined events do not support ‘data’ and ‘datatype’)

Then use Analytics Events. I had an idea that User-defined events did support this, but I am absolutely sure Analytics Events does.

hello again

i created a new analytics event, found it’s id and put it in the “type”. what comes in “source”?

i tried “InputEvent” - but got “Unknown source or invalid source format, retrieve valid sources from the configuration API” - it expects a camera id here? but the trigger is an external application, not camera…

{

“type”: “e04a952b-418a-429c-bde5-752757842ebd”,

“source”: “InputEvent”,

“data”: {

"snapshots": \[

  "[https://sensoguard-trailcam-images.s3.eu-west-1.amazonaws.com/1/1/0A2D7C1A-6283-412B-89B8-FC88272C4220.jpg](https://sensoguard-trailcam-images.s3.eu-west-1.amazonaws.com/1/1/0A2D7C1A-6283-412B-89B8-FC88272C4220.jpg)",

  "[https://sensoguard-trailcam-images.s3.eu-west-1.amazonaws.com/1/1/0A6A0159-5A3B-40EA-8155-F4D7AF771186.jpg](https://sensoguard-trailcam-images.s3.eu-west-1.amazonaws.com/1/1/0A6A0159-5A3B-40EA-8155-F4D7AF771186.jpg)"

\]

}

}

thanx

The source is described in the Introduction here - https://doc.developer.milestonesys.com/mipvmsapi/api/events-rest/v1/#section/Introduction

Source

The event source is the item where the event originated. For example, a camera. You can list all cameras with the Configuration REST API: Cameras.

hello again

I hope ill make my case clear this time:

our company has an application that manages incoming images and videos from cameras.

I am the developer of this application.

we want to add integration to Milestone - such that our application will trigger an incoming alarm in Milestone AND send some data into that trigger (for start - some URLs of the images/videos)

Please read the whole case conversation above - I tried everything you suggested, and I wrote the actual data i am trying to send and the results I get back

  1. the triggering “source” is our application - NOT a camera
  2. we need to be able to send data along with the event/alarm
  3. if you can - give me a request example that fits our case, with all its parameters and where to get them from
  4. if it’s possible - we can have a short online session so I can show you what Im doing

thank you,

Erez

Here is an example the works for me.

POST https://localhost/api/rest/v1/events
-
Body
{
  "type": "56d42c26-62aa-489a-bfef-1867970bda63",
  "source": "cameras/dacc7b2c-b819-4ddf-9d45-f4699fa342da",
  "datatype": "analytics",
  "tag": "My custom tag",
  "data": {
    "snapshots": [{ "image": "/9j/4AAQSkZJRgABAQEAYABgAAD/2wBDACodICUgGiolIiUvLSoyP2lEPzo6P4FcYUxpmYagnpaGk5GovfLNqLPltZGT0v/V5fr/////o8v///////L/////2wBDAS0vLz83P3xERHz/rpOu////////////////////////////////////////////////////////////////////wgARCAB4AKADASIAAhEBAxEB/8QAGAABAQEBAQAAAAAAAAAAAAAAAAIDAQT/xAAXAQEBAQEAAAAAAAAAAAAAAAAAAQIE/9oADAMBAAIQAxAAAAH0E8mqTQAAAAAAQtsSAZ81avO40aDMAHDrLurxqOdMwAABFjG7jWrYUVN0gZgAAAAADFtrURskms+1YzAAAAAGfeat9MwBFiLy7rWgzkAAAZWtedAkAAZ6LcdWWrsjuc0IAjjTVDMAAAAAyatXHXlAZgAAAAAAAAH/xAAfEAACAgIDAQEBAAAA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