Your achievements

Level 1

0% to

Level 2

Tip /
Sign in

Sign in to Community

to gain points, level up, and earn exciting badges like the new
Bedrock Mission!

Learn more

View all

Sign in to view all badges

SOLVED

API 2.0 - Created segments will not honor tags

Avatar

Level 1

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"
}

 

1 Accepted Solution

Avatar

Correct answer by
Level 1

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

View solution in original post

3 Replies

Avatar

Level 7

@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

Avatar

Level 1
I've tried via Postman and the swagger docs. Both yield a 200 but an empty tag array.

Avatar

Correct answer by
Level 1

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