Sent name of admin in soft trigger http request
AnsweredI have clients who have a bunch of Camera rules with soft trigger to unlock a door in the access control system. The access side has the ability to take a variable in the body of the http request so i can send the name of the Operator/Admin so they know who unlocked the door.
Body looks like: ({"SessionVars":{"admin":"Dave"}}
We have a soft trigger for every operator but making them and assigning permissions is becoming a hassle with the large amount of operators. Is there a way i can have the soft trigger put the name of the admin as a "variable" inside the body of the request depending on who clicks the soft trigger?
-
Hi @...,
I am sorry to tell you that we do not support putting the user name as the variable inside the content of the HTTP request currently.
For now, the only option is to set the individual event rule and action for different users, which you have already done.Just for your reference, if your access control system can send out the HTTP request as well, you can also set it to send the unlocking activity back to Nx Witness, and make the Nx Witness record as the bookmark.
1 -
Thanks. I can probably look but is it possible to add soft triggers through nxwitness web API? Might make it easier for me to automate the creation of soft triggers this way.
0 -
Hi @...,
You can do that through the API.
First you collect the data through the API with the following command:
https://localhost:7001/ec2/getEventRules
This way you'll get a JSON output, which you can parse with the following command:
https://localhost:7001/ec2/saveEventRule
For more details, please check the API documentation for both API calls.
This is how the JSON output of a Soft Trigger event would look like:
{ "actionParams": "{\"allUsers\":false,\"authType\":\"authBasicAndDigest\",\"durationMs\":5000,\"forced\":true,\"fps\":10,\"needConfirmation\":false,\"playToClient\":true,\"recordAfter\":0,\"recordBeforeMs\":1000,\"requestType\":\"\",\"streamQuality\":\"highest\",\"useSource\":false}", "actionResourceIds": [ "{2ab984a4-b807-6d2f-fc2f-9e01bbdac88d}" ], "actionType": "cameraOutputAction", "aggregationPeriod": 0, "comment": "", "disabled": false, "eventCondition": "{\"description\":\"_bell_on\",\"eventTimestampUsec\":\"0\",\"eventType\":\"undefinedEvent\",\"inputPortId\":\"30590b95-e700-448f-bcb6-cebca618d982\",\"metadata\":{\"allUsers\":false,\"instigators\":[\"{00000000-0000-0000-0000-100000000000}\"],\"level\":\"0\"},\"omitDbLogging\":false,\"reasonCode\":\"none\"}", "eventResourceIds": [ "{2ab984a4-b807-6d2f-fc2f-9e01bbdac88d}" ], "eventState": "Undefined", "eventType": "softwareTriggerEvent", "id": "{70e24fa6-24b9-44e8-abdb-05b7f0466ade}", "schedule": "", "system": false },0
Please sign in to leave a comment.
Comments
3 comments