Tags A tag is an asset property that you can use to group assets.
You can use the following resources:
• TagObjects. Use this resource to assign tags to an asset.• UntagObjects. Use this resource to remove tags from an asset.Assigning tags Use the TagObjects resource to assign tags to an asset.
POST request To assign a tag to an asset, use the following URI:
/public/core/v3/TagObjects
You can assign tags to a maximum of 100 assets in a request.
Include the following information for each asset:
Field
Type
Required
Description
id
String
Yes
Global unique identifier for the object.
tags
List
Yes
List of tags to assign to the object.
POST example To assign tags to two assets, you might use a POST request similar to the following example:
POST <baseApiUrl>/public/core/v3/TagObjects Content-Type: application/json Accept: application/json INFA-SESSION-ID: <sessionId> [{ "id":"5kuZuAC3Os0dycZuqGpqmM", "tags": ["R12 Tag", "DevQA"] }, { "id":"7feHjtC50mLb44CTW4Xmon", "tags": ["Prod", "DevQA", "R12 Tag"] }]
Returns the 204 response code if the request is successful. Returns errors if the request is unsuccessful. If the request is partially successful, returns information for the successful and unsuccessful transactions, as shown in the following example:
[{ "id": "9WfGCcHsygueFigGhAdWqh", "status": "FAILED", "msg": "Object: 9WfGCcHsygueFigGhAdWqh skipped, missing READ/UPDATE permissions." }, { "id": "0cLD48xB4TOgm8cNjP2kmJ", "status": "SUCCESS", "msg": "Object: 0cLD48xB4TOgm8cNjP2kmJ Operation Message: [Tag assignment succeeded for artifact 0cLD48xB4TOgm8cNjP2kmJ.]" }]
Removing tags Use the UntagObjects to remove tags from an asset.
POST request To remove a tag from an asset, use the following URI:
/public/core/v3/UntagObjects
You can remove tags from a maximum of 100 assets in a request.
Include the following information for each asset:
Field
Type
Required
Description
id
String
Yes
Global unique identifier for the object.
tags
List
Yes
List of tags to remove from the object.
POST example To remove tags from two assets, you might use a POST request similar to the following example:
POST <baseApiUrl>/public/core/v3/UntagObjects Content-Type: application/json Accept: application/json INFA-SESSION-ID: <sessionId> [{ "id":"5kuZuAC3Os0dycZuqGpqmM", "tags": ["R12 Tag", "DevQA"] }, { "id":"7feHjtC50mLb44CTW4Xmon", "tags": ["DevQA", "R12 Tag"] }]
Returns the 204 response code if the request is successful. Returns errors if the request is unsuccessful. If the request is partially successful, returns information for the successful and unsuccessful transactions, as shown in the following example:
[{ "id": "9WfGCcHsygueFigGhAdWqh", "status": "FAILED", "msg": "Object: 9WfGCcHsygueFigGhAdWqh skipped, missing READ/UPDATE permissions." }, { "id": "0cLD48xB4TOgm8cNjP2kmJ", "status": "SUCCESS", "msg": "Object: 0cLD48xB4TOgm8cNjP2kmJ Operation Message: [Tag assignment succeeded for artifact 0cLD48xB4TOgm8cNjP2kmJ.]" }]