How to Read and Write Metadata

Metadata can be recorded, updated, and deleted for each channel individually and for a group of channels. In the examples below, ACCESS_TOKEN should be replaced with an actual access token of the selected channel with "all" permission.

Base URL: web.skyvr.videoexpertsgroup.com/api/v4

Operations:

  • POST /meta/ Creates or replaces one or more meta documents

  • PUT /meta/ Updates one or more meta documents

  • DELETE /meta/ Deletes one or more meta documents

  • POST /meta/filter/ Returns search hits that match the query defined in the request

  • DELETE /meta/filter/ Deletes meta documents that match the query defined in the request

 

For example, to write metadata for a selected channel we will use the following function:

curl -X POST "https://web.skyvr.videoexpertsgroup.com/api/v4/meta/" -H "accept: application/json" -H "Authorization: Acc ACCESS_TOKEN -H "Content-Type: application/json" -d "[ { \"timestamp\": \"2021-08-06T00:01:00.947\", \"long\": { \"people_count\": 12, \"cars_count\": 1 }, \"float\": { \"luminosity\": 0.114 }, \"string\": { \"objects\": \"people,cars\", \"location\": \"street\" }, \"raw_data\": \"Scene detector a0014_j\" } ]"

The response will contain the status and id of the record:

{ "objects": [ { "status": 201, "id": "prod_cmt0006_240160_9541c83575b9d4579bb365487192926b" } ], "meta": { "errors_count": 0, "total_count": 1 } }

 

Example of retrieving metadata:

curl -X POST "https://web.skyvr.videoexpertsgroup.com/api/v4/meta/filter/" -H "accept: application/json" -H "Authorization: Acc ACCESS_TOKEN -H "Content-Type: application/json" -d "{ \"filter\": { \"and\": [ { \"field\": \"timestamp\", \"gte\": \"2021-08-06T00:00:00\", \"lte\": \"2021-08-07T00:00:00\" } ] } }"

The response: