Create Event API
AnsweredHi
I am trying to create a generic event, via the web API using PHP.
I have written the following sample code
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL,$urlToCall);
curl_setopt($ch, CURLOPT_RETURNTRANSFER,1);
curl_setopt($ch, CURLOPT_HTTPAUTH, CURLAUTH_ANY);
curl_setopt($ch, CURLOPT_USERPWD, "$username:$password");
$result = curl_exec($ch);
curl_close($ch);
print_r($result);
Where $username and password are my credentials.
I get the reply '{"error":"0","errorString":"","reply":null}' however I can't see any Generic camera events appearing in NX Witness.
-
Hello Tim,
Error code 0 indeed says that server has successfully processed your request.
But in order to see it in the Event Log, this message must become an input for the Event Engine.
For that, "On Generic Event" must exist, be enabled and have proper access rights to be seen by a certain system user:
One more important note. This event has filter options for the Source, Caption and Description. Check that your input matches those filters. E.g. in my case it's just empty:

Thus when I call url you posted here modifying only server address field I get the following:

Let us know if you are sure that all settings are correct but you still can't see the event in the logs.
0 -
Hi @...,
I was just wondering if you managed to resolve the issue, or our support is still required?
0
Please sign in to leave a comment.
Comments
2 comments