Edit in GitHubLog an issue

Tags API

The Analytics 2.0 Tags APIs allow you to retrieve, update, or create tags and their association with components programmatically through Adobe Developer. The APIs use the same data and methods that are used when working with tags in the UI.

Retrieve multiple tags

Retrieve a list of tags that the user can access.

GET https://analytics.adobe.io/api/{GLOBALCOMPANYID}/componentmetadata/tags

You can paginate results by using the limit and page query strings.

  • limit: An integer that represents the number of results per page.
  • page: An integer that represents which page to return results.

For example, use the page and limit query strings to only retrieve the first 3 tags in a company:

Copied to your clipboard
curl -X GET "https://analytics.adobe.io/api/{GLOBALCOMPANYID}/componentmetadata/tags?page=0&limit=3" \
-H 'Accept: application/json' \
-H 'Authorization: Bearer {ACCESSTOKEN}' \
-H 'x-api-key: {CLIENTID}'

Retrieve a single tag

Retrieves information around the specified tag ID.

GET https://analytics.adobe.io/api/{GLOBALCOMPANYID}/componentmetadata/tags/{ID}

For example, get details around a tag with the ID of 35632:

Copied to your clipboard
curl -X GET "https://analytics.adobe.io/api/{GLOBALCOMPANYID}/componentmetadata/tags/35632" \
-H 'Accept: application/json' \
-H 'Authorization: Bearer {ACCESSTOKEN}' \
-H 'x-api-key: {CLIENTID}'

Retrieve a list of components by tag

Retrieve all components of specific type associated with tag names.

GET https://analytics.adobe.io/api/{GLOBALCOMPANYID}/componentmetadata/tags/tagnames?tagNames={TAGNAMES}

This API call requires the tagNames query string. Query string values include a comma-separated list of tag names to search. For example, retrieve calculated metrics associated with any one of multiple tags.

Copied to your clipboard
curl -X GET "https://analytics.adobe.io/api/{GLOBALCOMPANYID}/componentmetadata/tags/tagnames?tagNames=Sales,Marketing&componentType=calculatedMetric" \
-H 'Accept: application/json' \
-H 'Authorization: Bearer {ACCESSTOKEN}' \
-H 'x-api-key: {CLIENTID}'

Retrieve all tags for one or more components

Retrieve a list of tags tied to one or more components.

GET https://analytics.adobe.io/api/{GLOBALCOMPANYID}/componentmetadata/tags/search?componentId={ID}&componentType={TYPE}

This API call requires two query string parameters:

  • componentId: The ID of the component(s). Separate multiple ID's with a comma.
  • componentType: The type of the component. Valid component types include:
    • segment
    • dashboard
    • bookmark
    • calculatedMetric
    • project
    • dateRange
    • metric
    • dimension
    • virtualReportSuite
    • scheduledJob
    • alert
    • classificationSet

For example, retrieve the tags associated with two bookmarks:

Copied to your clipboard
curl -X GET "https://analytics.adobe.io/api/{GLOBALCOMPANYID}/componentmetadata/tags/search?componentId=bookmark1,bookmark2&componentType=bookmark" \
-H 'Accept: application/json' \
-H 'Authorization: Bearer {ACCESSTOKEN}' \
-H 'x-api-key: {CLIENTID}'

Retrieve tags for multiple components

Finds one or more tags with desired values.

POST https://analytics.adobe.io/api/{GLOBALCOMPANYID}/componentmetadata/tags/component/search

This API call requires a JSON request body to determine search criteria. For example:

Copied to your clipboard
{
"componentType": "project",
"componentIds": [
"component-id-556"
]
}

This API call sends a JSON request body with search criteria. Adobe returns the first three projects that contain that component.

Copied to your clipboard
curl -X POST "https://analytics.adobe.io/api/{GLOBALCOMPANYID}/componentmetadata/tags/component/search?page=0&limit=3" \
-H 'Accept: application/json' \
-H 'Authorization: Bearer {ACCESSTOKEN}' \
-H 'Content-Type: application/json' \
-H 'x-api-key: {CLIENTID}' \
-d '{"componentType": "project", "componentIds": ["component-id-556"]}'

Create a tag

Creates tags for use with components.

POST https://analytics.adobe.io/api/{COMPANY_ID}/componentmetadata/tags

This API call requires a JSON request body so it can create the desired tag. The JSON request body is an array of tags to create. For example:

Copied to your clipboard
[
{
"name":"Tag name",
"description":"Description",
"components":[
{
"componentType":"project",
"componentId":"component-id-1"
}
]
}
]

The following example API call performs several actions:

  • Creates two tags named "Sales Department" and "Marketing Department"
  • Ties "Sales Department" with two components: one with ID component-id-1 and component-id-2
  • Ties "Marketing Department" with two components: one with ID component-id-3 and component-id-4
Copied to your clipboard
curl -X POST "https://analytics.adobe.io/api/{GLOBALCOMPANYID}/componentmetadata/tags" \
-H 'Accept: application/json' \
-H 'Authorization: Bearer {ACCESSTOKEN}' \
-H 'Content-Type: application/json' \
-H 'x-api-key: {CLIENTID}' \
-d '[{
"name":"sales",
"description":"Sales Department",
"components":[{
"componentType":"project",
"componentId":"component-id-1"
},{
"componentType":"segment",
"componentId":"component-id-2"
}
]
},
{
"name":"marketing",
"description":"Marketing Department",
"components":[
{
"componentType":"project",
"componentId":"component-id-3"
},
{
"componentType":"segment",
"componentId":"component-id-4"
}
]
}
]'

Delete a tag

Deletes a tag. It also untags all components associated with the tag.

DELETE https://analytics.adobe.io/api/{GLOBALCOMPANYID}/componentmetadata/tags/{TAG_ID}

For example, deletes a tag with the ID 38945 and untags all components associated with it.

Copied to your clipboard
curl -X DELETE "https://analytics.adobe.io/api/{GLOBALCOMPANYID}/componentmetadata/tags/38945" \
-H 'Accept: application/json' \
-H 'Authorization: Bearer {ACCESSTOKEN}' \
-H 'x-api-key: {CLIENTID}' \

Remove all tags from component(s)

Removes all tags from list of components.

DELETE https://analytics.adobe.io/api/{GLOBALCOMPANYID}/componentmetadata/tags?componentId={ID}&componentType={TYPE}

This API call requires two query string parameters:

  • componentId: The ID of the component(s). Separate multiple ID's with a comma.
  • componentType: The type of the component. Valid component types include:
    • segment
    • dashboard
    • bookmark
    • calculatedMetric
    • project
    • dateRange
    • metric
    • dimension
    • virtualReportSuite
    • scheduledJob
    • alert
    • classificationSet

For example, remove all tags associated with two segments.

Copied to your clipboard
curl -X DELETE "https://analytics.adobe.io/api/{GLOBALCOMPANYID}/componentmetadata/tags?componentIds=segment1,segment2&componentType=segment" \
-H 'Accept: application/json' \
-H 'Authorization: Bearer {ACCESSTOKEN}' \
-H 'x-api-key: {CLIENTID}' \

Overwrite tags for components

Set the tags for one or more components. This endpoint overwrites all existing tags for the component, meaning that existing tags are removed.

PUT https://analytics.adobe.io/api/{GLOBALCOMPANYID}/componentmetadata/tags/tagitems

This API call requires a JSON request body that contains the components to update and the tags to set. For example:

Copied to your clipboard
[
{
"componentType":"project",
"componentId":"component-id-1",
"tags":[
{
"name":"marketing-1",
"description":"marketing 1"
},
{
"name":"marketing-2",
"description":"marketing 2"
}
]
}
]

For example, this API call performs several actions:

  • Creates two tags named "marketing-1" and "marketing-2"
  • Ties these two tags with the component component-id-1
  • If there are any existing tags tied with component-id-1, remove those ties.
Copied to your clipboard
curl -X PUT "https://analytics.adobe.io/api/{GLOBALCOMPANYID}/componentmetadata/tags/tagitems" \
-H 'Accept: application/json' \
-H 'Authorization: Bearer {ACCESSTOKEN}' \
-H 'Content-Type: application/json' \
-H 'x-api-key: {CLIENTID}' \
-d '[{"componentType":"project",
"componentId":"component-id-1",
"tags":[{
"name":"marketing-1",
"description":"marketing 1"},
{"name":"marketing-2",
"description":"markerting 2"}]
}
]'
  • Privacy
  • Terms of Use
  • Do not sell or share my personal information
  • AdChoices
Copyright © 2024 Adobe. All rights reserved.