Fetching tags

Fetching tags

A Tag is a meaningful label you can assign to your content items, customers and assets to differentiate between them while filtering.

The Tag object

{
    "id": "df7c1544-bad0-4c9d-928f-0c9f684c9ceb",
    "created_on": "2023-01-23T14:34:59+00:00",
    "changed_on": "2023-01-23T14:34:59+00:00",
    "label": "Tag",
    "body": "Amsterdam",
    "slug": "amsterdam"
}
FIELDDESCRIPTION
idUnique identifier for each item.
created_onUTC time at which the segment was created.
changed_onUTC time at which the segment was last updated.
labelIdentifier for the object.
bodyName of the tag.
slugCustom tag API ID.

Fetching all tags

GET: /tags

The pagination of the tags endpoint is identical to the content items endpoints.

Query by ID

Since IDs are unique in Prepr, you can find the tag you want using the id argument. Here is an example that demonstrates how to query a tag with the ID "535c1e-...":

GET: /tags/535c1e-4d52-4794-9136-71e28f2ce4c1

Managing tags

Fields

argumenttyperequireddescription
bodyStringtrueDefines the tag.
{
    "body": "Dog"
}

Create

To create a tag.

POST: /tags

Update

To update a tag.

PUT: /tags/{id}

Destroy

To destroy a tag.

DELETE: /tags/{id}

Tag Groups (deprecated)

Fetching all tag groups

GET: /tag_groups

Managing tag groups

Fields

argumenttyperequireddescription
bodyStringtrueDefines the name of the tag group.
tagsObjectfalseDefines the tags inside of the tag group.
{
    "body": "Taggroup 1",
    "tags": {
        "items": [
            {
                "id": "00a92e60-24bd-4908-a36c-96268465111f",
                "body" : "Amsterdam"
            }
        ]
    }
}

Create

To create a tag group.

POST: /tag_groups

Update

To update a tag group.

PUT: /tag_groups/{id}

Destroy

To destroy a tag group.

DELETE: /tag_groups/{id}

Was this article helpful?

We’d love to learn from your feedback