API 2.0 - Created segments will not honor tags | Community
Skip to main content
June 4, 2021
Solved

API 2.0 - Created segments will not honor tags

  • June 4, 2021
  • 2 replies
  • 1260 views

Howdy! I'm using the API to create a new segment and when the response comes back (as a 200), tags is just an empty array. Am I doing something wrong or is this some kind of bug with the API?

 

POST to https://analytics.adobe.io/api/kroger1/segments?expansion=tags

Also, it seems that no matter what ownerID I use, I am the owner of the segment created. ¯\_(ツ)_/¯

Payload:

 

{ "name": "chris-test-segment", "description": "A segment created using the Adobe REST API", "rsid": "MYRSID", "owner": { "id": OWNERID }, "definition": { "container": { "context": "hits", "func": "container", "pred": { "str": "my-test_A", "val": { "func": "attr", "name": "variables/evar171" }, "func": "contains", "description": "AB Test: Groups (v171)" } }, "func": "segment", "version": [ 1, 0, 0 ] }, "tags": [ { "id": 119957, "name": "ABTesting", "components": [] }, { "id": 125841, "name": "Test", "components": [] }, { "id": 154050, "name": "AB Test ", "components": [] } ], "modified": "2021-06-04T16:22:53.842Z", "created": "2021-06-04T16:22:53.842Z" }

 

This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.
Best answer by sesamechicken

Got the answer via GitHub - tagging segments upon creation is not supported and one must use the `/componentmetadata/tags` endpoint to tag newly created segments.

 

Ref: https://github.com/AdobeDocs/analytics-2.0-apis/issues/200#issuecomment-856044712

2 replies

Level 7
June 7, 2021

@sesamechicken  Can you try the same request on swagger UI as given below ? Make sure that all the required parameters are filled in proper format.

https://adobedocs.github.io/analytics-2.0-apis/#/segments/segments_createSegment

June 7, 2021
I've tried via Postman and the swagger docs. Both yield a 200 but an empty tag array.
sesamechickenAuthorAccepted solution
June 8, 2021

Got the answer via GitHub - tagging segments upon creation is not supported and one must use the `/componentmetadata/tags` endpoint to tag newly created segments.

 

Ref: https://github.com/AdobeDocs/analytics-2.0-apis/issues/200#issuecomment-856044712