Keeping Your Media Organized with Tags

Tagging your assets in SHIFT is a great way to add more organization to large media catalogues. Tags are searchable using queries, too. So, finding your assets based on a given tag or tags is useful.

Any tags you create on an asset in SHIFT will show up in the tag section for the asset. You can search for your asset using the same API's that the SHIFT app uses.

Let's start by adding a tag to an asset.

Adding a Tag

Adding a tag is simple. You just need to know the ID of the asset that you'd like to tag. (Check out the asset API reference for retrieving a list of the assets that you have access to). The following example shows how to tag an asset in SHIFT.

curl --request POST \
  --url https://api.shift.io/v3/assets/YOUR_ASSET_ID/tags \
  --header 'accept: application/json' \
  --header 'content-type: */*' \
  --header 'x-key: YOUR_API_KEY' \
  --header 'x-secret: YOUR_API_SECRET'
  --data '{ "tags": ["ocean", "wave", "green-room"] }'

Let's see how to edit tags.

Editing Tags

It can be important to keep your tag names consistent and it's common to make mistakes when choosing the names we use for tags. If you change the name of a tag it will update all of its uses across all of your assets. Here's an example of how to edit a tag.

curl --request PUT \
  --url https://api.shift.io/v3/tags \
  --header 'accept: application/json' \
  --header 'content-type: */*' \
  --header 'x-key: YOUR_API_KEY' \
  --header 'x-secret: YOUR_API_SECRET'
  --data '{ "currentName": "oshin", "newName": "ocean" }'

The above example will change any tag currently named "oshin" to "ocean"

Let's take a look at how to search for assets using tags.

Searching for Assets by Tag

You can find assets that have one or more tags by following the SHIFT API query support. . The following examples show how to find assets tagged with a single tag and multiple tags.

Single tag search

curl --request GET \
  --url https://api.shiftio/v3/assets?tags={"in":"ocean"} \
  --header 'accept: application/json' \
  --header 'x-key: YOUR_API_KEY' \
  --header 'x-secret: YOUR_API_SECRET'

Multi tag search

curl --request GET \
  --url https://api.shiftio/v3/assets?tags={"in":"ocean,wave,surf"} \
  --header 'accept: application/json' \
  --header 'x-key: YOUR_API_KEY' \
  --header 'x-secret: YOUR_API_SECRET'

Did this page help you?