Tag websites
Make a tag, put it on websites with Update a website, and take it off again.
Tags group websites, such as "Pre-production" or "Faculty of Arts", so people can filter them in Silktide and reports can cover every website with a tag. Silktide 5 shows them as labels; they are the same thing. This guide makes a tag and puts it on a website.
1. Find or create the tag#
List the account's tags and look for one whose entityType is section. Those are the tags for websites and their sections; document and task tags are for other things.
If the tag you want is not there, create it:
curl https://api.eu.silktide.com/v1/tags \
-H "Authorization: silktide token=$SILKTIDE_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"tag": {
"tagId": "pre-production",
"label": "Pre-production",
"entityType": "section"
}
}'Use its tagId, not its label, from here on.
2. Set the website's tags#
Send the website's whole set of tags as tagIds to Update a website:
curl -X PUT https://api.eu.silktide.com/v1/websites/6 \
-H "Authorization: silktide token=$SILKTIDE_API_KEY" \
-H "Content-Type: application/json" \
-d '{ "tagIds": ["pre-production", "faculty-of-arts"] }'tagIds replaces the website's tags; it does not add to them. To add one tag, read the website's tagIds with Get a website, add the new id, and send the whole list back. To remove every tag, send []. Leave tagIds out and its tags stay as they are.
Each id you add must be one of the account's section tags, so create the tag first. Any other id, including a task or document tag's, is refused with 400 and an InvalidRequest error whose properties.field is tagIds, and nothing in the request is saved.
You can also send tagIds when you create a website.
3. Use the tag#
- In reports and report schedules,
context.criteria.tagIdscovers every website and section with those tags. See Create a report. - Update a tag changes its label or color on every website that has it.
- Delete a tag takes it off every website that has it.