Tag your content

This guide explains how to create a video with associated tags and provides instructions on how to add or remove tags when making a cURL POST request.

Creating a Video with Tags

To create a video with tags, you can make a cURL POST request with the following Add a new video

curl -X GET\
     '<<SBX_SERVER>>/videos' \
     -H 'accept: application/json' \
     -H 'x-api-key: <<SBX_DEMO_KEY>>' \
     -d '{
  "tags": [
    "tag1",
    "tag2"
  ],
  "title": "Your Video Title",
  "description": "Your Video Description"
}'

In this cURL request, the "tags" parameter is an array that allows you to associate one or more tags with your video. You can specify the tags you want to add to the video by providing them in the array.

Adding Tags

To add additional tags to an existing video, you can follow these steps:

  1. Retrieve the existing video information, including its current tags.
  2. Modify the list of tags by adding the new tag(s) you want to include.
  3. Make a cURL PUT request to update the video's information, including the updated list of tags.

Here's an example cURL request to update the tags of an existing video:

curl -H PUT\
      '<<SBX_SERVER>>/videos/{video_id}' \
     -H 'accept: application/json' \
     -H 'x-api-key: <<SBX_DEMO_KEY>>' \
     -d '{
  "tags": [
    "tag1",
    "tag2",
    "newTag"
  ],
  "title": "Your Video Title",
  "description": "Your Video Description"
}'

In this request, the "tags" parameter contains the updated list of tags, including the new tag ("newTag") that you want to add.

Removing Tags

To remove tags from an existing video, follow these steps:

  1. Retrieve the existing video information, including its current tags.
  2. Modify the list of tags by removing the tag(s) you want to delete.
  3. Make a cURL PUT request to update the video's information, including the updated list of tags (without the removed tag(s)).

Here's an example cURL request to remove a tag from an existing video:

curl -X PUT\
     '<<SBX_SERVER>>/videos/{video_id}' \
     -H 'accept: application/json' \
     -H 'x-api-key: <<SBX_DEMO_KEY>>' \
     -d '{
  "tags": [
    "tag1"
  ],
  "title": "Your Video Title",
  "description": "Your Video Description"
}'

In this request, the "tags" parameter contains the updated list of tags without the tag you want to remove.

By following these steps and using cURL requests, you can efficiently manage and update the tags associated with your video content.


What’s Next