AdobeDocs/analytics-2.0-apis

POST /segments - not saving tags

Closed this issue · 2 comments

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

Payload to /segments:

{
  "name": "chris-test-segment",
  "description": "A segment created using the Adobe REST API",
  "rsid": "MY_RSID",
  "owner": {
    "id": "SOMEONE_ELSES_OWNER_ID"
  },
  "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"
}

As you can see, I pass 3 tags in, and what I get out is:

{
    "name": "chris-test-segment",
    "description": "A segment created using the Adobe REST API",
    "id": "s300000624_60ba654844983d5af85481ff",
    "tags": [],
    "isPostShardId": true,
    "rsid": "MY_RSID",
    "owner": {
        "id": "MY_OWNER_ID"
    }
}

We use and depend heavily on the tags applied to segments. Is there some kind of access restriction on tags?
Any help is greatly appreciated!

This is not an access restriction. The metadata is stored in a separate place and a POST to segments does not forward that data on to the other service.
You can update the tags with a call to https://www.adobe.io/apis/experiencecloud/analytics/docs.html#!AdobeDocs/analytics-2.0-apis/master/tags.md and then the GET will include them (by calling the other service behind the scenes).
We will update the docs to make this more clear.

This is not an access restriction. The metadata is stored in a separate place and a POST to segments does not forward that data on to the other service.
You can update the tags with a call to https://www.adobe.io/apis/experiencecloud/analytics/docs.html#!AdobeDocs/analytics-2.0-apis/master/tags.md and then the GET will include them (by calling the other service behind the scenes).
We will update the docs to make this more clear.

I appreciate this and will try it!

I definitely think an update is in order, as all of the docs support sending an array of tags with the creation of a segment (including swagger), and this separate call is not documented anywhere in relation to creating segments (that I could find).

Thanks again!

Thanks!