Tag a Content Item

The process of tagging a content item (or removing tags) is no different from any other change you might make to a content item. You simply:

  1. Retrieve the content item as an Atom entry resource (as described in Change a Content Item).

  2. Insert one or more Atom category elements into the retrieved entry, or remove unwanted category elements. category elements must be inserted as children of the entry element, but can be in any position (i.e, order is not significant).

  3. Save the modified entry in a file.

  4. PUT the file back to the same URI from which it was retrieved (as described in Change a Content Item).

Any category elements you add must have the following format:

<category term="term" scheme="scheme-uri"/>

where:

term

is the term or local identifier of the tag within its tag structure. This may be a meaningful name such as politics if the tag structure has been imported, but if the tag has been created using Content Studio then it will be something like db:1234.

scheme-uri

is a URI that identifies the tag structure to which the tag belongs.

If the content item you retrieve is already tagged, you will see that the category elements for the existing tags also contain label attributes. The label attribute is, however, not required when adding a tag, and is ignored if supplied.