Expand my Community achievements bar.

SOLVED

Approving and Sharing Segments

Avatar

Level 3

Hi Team,

 

Currently I am working with Adobe Analytics APIs. I just wanted to know , is there any way to approve and share segments via APIs. I covered below documents, but didn't find anything suitable for me or  am I missed something ?

 

https://www.adobe.io/apis/experiencecloud/analytics/docs.html#!AdobeDocs/analytics-2.0-apis/master/s...

 

https://www.adobe.io/apis/experiencecloud/analytics/docs.html#!AdobeDocs/analytics-2.0-apis/master/s...

 

Thanks in advance.

1 Accepted Solution

Avatar

Correct answer by
Employee

I believe the solution you are after is the "component-metadata - shares" endpoint as documented here: 
https://adobedocs.github.io/analytics-2.0-apis/#/component-metadata%20-%20shares/updateShares

https://www.adobe.io/apis/experiencecloud/analytics/docs.html#!AdobeDocs/analytics-2.0-apis/master/s...

The UI uses this api when a share is made in the ui . Referencing the requests there may aid you in your proof of concept and troubleshooting the API (please note the UI will use a slightly different endpoint than you would use and is documented in the documentation linked above):

Screen Shot 2021-11-10 at 7.51.01 AM.png



I've never used this particular API, but it appears to be suggesting the functionality you are after. I would test it on some test segments, before starting any big project.  


View solution in original post

4 Replies

Avatar

Employee Advisor

@deepakkv  The segements sharing and approve is controlled in Adobe analytics UI, you would not be able control that with the APIs, Analytics APIs are used for fetching data from adobe analytics, you can fetch the segment data through the API , but not sharing and approving them 

Avatar

Correct answer by
Employee

I believe the solution you are after is the "component-metadata - shares" endpoint as documented here: 
https://adobedocs.github.io/analytics-2.0-apis/#/component-metadata%20-%20shares/updateShares

https://www.adobe.io/apis/experiencecloud/analytics/docs.html#!AdobeDocs/analytics-2.0-apis/master/s...

The UI uses this api when a share is made in the ui . Referencing the requests there may aid you in your proof of concept and troubleshooting the API (please note the UI will use a slightly different endpoint than you would use and is documented in the documentation linked above):

Screen Shot 2021-11-10 at 7.51.01 AM.png



I've never used this particular API, but it appears to be suggesting the functionality you are after. I would test it on some test segments, before starting any big project.  


Avatar

Level 3

Hi Garretth, 
This is useful. Now I can able share the segment.

Still not able to approve it. Is it possible to approve it using this APIs ?  

Avatar

Employee

I think you should be able to publish using the update https://www.adobe.io/apis/experiencecloud/analytics/docs.html#!AdobeDocs/analytics-2.0-apis/master/s...

"Updating a Segment

You can edit existing segments with the PUT /segments/{id} endpoint. Some fields cannot be edited on a segment with the PUT endpoint, including tags, compatibility, and reportSuiteName. Other fields, including owner, name, description, rsid, and definition, can be edited.

The PUT endpoint also supports partial updates. This means that instead of sending the entire JSON object to the API, you can simply send fields that you want to update. For example, if you only want to update the name, use the JSON {"name":"Updated name"}. The entire object is returned in the response, modified by the requested expansions."

When I look at the request made when I publish in the UI the updated field appears to be: 

publishingStatus: {lookbackPeriod: 0, published: true}