How to use dynamic fields with "Do HTTP Request" ?
CompletedHi ,
I'm trying to have Nx send a POST message to my server whenever a generic event is received , a few questions :
1.Can I use dynamic fields with the HTTP repsonse :
2. Which fields can be used dynamically ?
3.What's the correct syntax for using then?

-
Hello RC ,
For the first source of information, please consult built in help in the Nx Desktop client.
Search for "Do HTTP Request" and for "Generic Event"
For the second, please, refer this thread
https://support.networkoptix.com/hc/en-us/community/posts/360043924814-Push-Notifications-and-Event-Rules-Variables-for-HTTP-Post-Event
and possibly this onehttps://support.networkoptix.com/hc/en-us/community/posts/360048397554-Create-Event-API
0 -
Hi Andrey,
Thank you for your prompt reply . I can now get dynamic data on my server, though only for some fields : cameraId , cameraName , eventName , and eventType don't seem to provide any info.

This is the command I am using to create my generic events.
http://Admin:Aa123456*@192.168.1.32:7001/api/createEvent?source=nred-camera&caption=nred-api-test-cameraId&description=testing%20from%20node%20red%20with%20camera%20id&metadata={"cameraRefs":["ddf3271a-37c8-1671-9b8d-666ef826b3c3"]}0 -
Hello RC,
You are triggering a Generic event.
According to the built-in help article for "Do HTTP Request" event action
for Generic Event, {event.caption} and {event.description} are available at the moment.
So, the situation you've presented on a screenshot is quite expected, i.e. for Generic event {event.cameraId} , {event.cameraName} , {event.eventName} and {event.eventType} are NOT available.
1 -
Hi Andrey ,
I thought that if the camera ID was supplied to the generic event it could then in turn be reflected in the POST command, but from your explanation all generic events provide the same info.
Thanks for your clarification.
0
Please sign in to leave a comment.
Comments
4 comments