Skip to main content

Get a tag by its id or provide options to find a tag by its label

Call signatures

TypeScript
get(id: string): Promise<Tag>;

get({
    groupId: string;
    label: string;
    language?: string;
}: TagGetByLabelOptions): Promise<Tag>;

Parameters

NameTypeDescription
idstringThe tag GUID identifier
optionsTagGetByLabelOptionsAn options object to find a tag in a known tag group by its label and in a specific language

Returns

A Promise that will resolve with a Tag

Remarks

Throws any error that is returned by the API for any unsuccessful request echoing the HTTP status returned from the API

Examples

Get a tag by its GUID identifier

TypeScript
const tag = await client.tags.get("109eb3e9-98c9-5ab2-b9df-f1c80af3ac5c");

Get a tag from a specific tag group by its label and label's language

TypeScript
const tag = await client.tags.get({
    groupId: "topics",
    label: "Books",
    language: "en-GB"
});

Still need help?

If you still need help after reading this article, don't hesitate to reach out to the Contensis community on Slack or raise a support ticket to get help from our team.
New support request