Skip to main content
Skip table of contents

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:

CODE
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:

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

Example of retrieving metadata:

CODE
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:

CODE
{
  "objects": [
    {
      "timestamp": "2021-01-25T00:01:02.947",
      "long": {
        "people_count": 12,
        "cars_count": 1
      },
      "float": {
        "luminosity": 0.114
      },
      "string": {
        "objects": "people,cars",
        "location": "street"
      },
      "raw_data": "Scene detector a0014_j",
      "id": "prd_cmt0000_huJcWHcB5abuaaFTMQiN"
    }
  ],
  "meta": {
    "limit": 300,
    "next_offset": "ZMDyUdhWzETTNM",
    "total_count": 8107
  }
}

JavaScript errors detected

Please note, these errors can depend on your browser setup.

If this problem persists, please contact our support.