Update Bookmark Error via REST API
AnsweredHi,
I update bookmark via the REST API and recently updated my code to function with the new REST API in V5.
Only on specific cameras I get an error when updating bookmarks (/rest/v1/devices/):
{'error': '9', 'errorId': 'notFound', 'errorString': "Resource '{d40d33bb-5555-497e-9cd1-d57f52a6b7a4}' is not found"}
When I submit an update API call with the same information but using the deprecated API the bookmark updates correctly (/ec2/bookmarks/update)
I have tried to update bookmarks via the NX Witness WEB API documentation and I get the same update error. May you please advise on this error?
Regards,
Reynard
-
Hi Reynard Bubb
For updating bookmarks use Modify Bookmark endpoint:
https://localhost:7001/#/api-tool/rest-v1-devices-deviceid-bookmarks-id-patch?version=current%20apicurl --insecure -X PATCH "https://localhost:7001/rest/v1/devices/c9de29dc-4c88-5e47-5cbb-9cccd6760881/bookmarks/2cab1bc8-c5ab-448a-b9de-eee8ed6db91e"
-H "accept: application/json"
-H "Content-Type: application/json"
-H "Authorization: Bearer vms"
-d "{\"name\":\"String\"}"curl above works for me (I substituted my auth token)
JIRA-VMS-36289
-
As you've mentioned that it's only reproduced on specific cameras -- can you provide more info about this aspect?
Also, specific API calls with results of API calls that lists all available bookmarks might be helpful for troubleshooting. E.g., output of GET /rest/v1/devices/*/bookmarks -
Hi Tagir,
Sure, I use the /rest/v1/devices/*/bookmarks endpoint to pull bookmark information. Then I use that information to update the bookmark tags with the /rest/v1/devices/{deviceId}/bookmarks/{id} endpoint. When submitting the modify bookmark call I receive the error message "Resource '{d40d33bb-5555-497e-9cd1-d57f52a6b7a4}' is not found". When I take that same bookmark information and submit it via the deprecated API endpoint ec2/bookmarks/update, the bookmark updates correct.
It only happens to certain cameras as mentioned. I did not see this behavior in my dev environment but as soon as I deployed the update to our production environment I saw the update error. We have 4 VMS servers in a hive configuration with a total of about 120 cameras.
Please see the below screenshots of the API requests made via the
Get Bookmark:
Update above bookmark:
Response:
Hope this helps - let me know if you need more information.
-
Hello Reynard Bubb ,
What you've described seems to be a bug in the web tool. I checked with Postman, API function works as expected.
Please sign in to leave a comment.
Comments
4 comments