Hello,
Is anyone aware of an API format to provide a GET request that would return audiences (segments) that are present under a given destination? I can't seem to find my way around this one.
Thank you,
David
@DavidRoss91 You can use Retrieve with dataflow API to get the audience details activate, use the destination id console retrieve using API SPEC below, let me know if you need more help.
Please close this thread accordingly.
I do understand that I can pull the data via those API's. But what I am trying to do would essentially be:
Destination A (Activated Audiences)
-Audience 1
-Audience 2
-Audience 3
Destination B (Activated Audiences)
-Audience 4
-Audience 5
-Audience 6
Without having to manually pull all of this data. I don't see a way via API that a call will return the list of all audiences attached to a specific destination.
@DavidRoss91 There is no direction API for this, you need to parse the response to get the detailed format with scripting languages.
If this is for quick report, you can establish with postman post response scripting or JSONPath Visualizer.
This is how I do it:
1) Use the API to get flow details:
2) Save the response to a .json file on your desktop, open up MS Excel, then create a blank worksheet. Go to Data > From File > From JSON
3) Locate the .json file that contains the API result from step 1. Once loaded, click the “Into Table” button.
4) On the next screen, click “Advanced Editor” to open the PowerQuery editor.
5) Paste the code below and click Done. Note: Replace the path and filename with the path and filename of your .json file.
// all
let
Source = Json.Document(File.Contents("<Path and File name of your json file>")),
items1 = Source[items],
#"Converted to Table" = Table.FromList(items1, Splitter.SplitByNothing(), null, null, ExtraValues.Error),
#"Expanded Column1" = Table.ExpandRecordColumn(#"Converted to Table", "Column1", {"name", "state", "inheritedAttributes", "transformations"}, {"name", "state", "inheritedAttributes", "transformations"}),
#"Expanded inheritedAttributes" = Table.ExpandRecordColumn(#"Expanded Column1", "inheritedAttributes", {"properties"}, {"properties"}),
#"Expanded properties" = Table.ExpandRecordColumn(#"Expanded inheritedAttributes", "properties", {"isDestinationFlow"}, {"isDestinationFlow"}),
#"Expanded transformations" = Table.ExpandListColumn(#"Expanded properties", "transformations"),
#"Expanded transformations1" = Table.ExpandRecordColumn(#"Expanded transformations", "transformations", {"params"}, {"params"}),
#"Expanded params" = Table.ExpandRecordColumn(#"Expanded transformations1", "params", {"segmentSelectors"}, {"segmentSelectors"}),
#"Expanded segmentSelectors" = Table.ExpandRecordColumn(#"Expanded params", "segmentSelectors", {"selectors"}, {"selectors"}),
#"Expanded selectors" = Table.ExpandListColumn(#"Expanded segmentSelectors", "selectors"),
#"Expanded selectors1" = Table.ExpandRecordColumn(#"Expanded selectors", "selectors", {"value"}, {"value"}),
#"Expanded value" = Table.ExpandRecordColumn(#"Expanded selectors1", "value", {"name", "schedule"}, {"name.1", "schedule"}),
#"Expanded schedule" = Table.ExpandRecordColumn(#"Expanded value", "schedule", {"frequency", "triggerType", "startDate", "endDate"}, {"frequency", "triggerType", "startDate", "endDate"})
in
#"Expanded schedule"
6) It will load a preview of the json file. Click “Close & Load” to exit the PowerQuery editor.
7) Filter column C for “True” values. You now have the list of Destinations and activated segments.
@DavidRoss91 Did you find the suggestion helpful? Please let us know if you require more information. Otherwise, please mark the answer as correct for posterity. If you've discovered a solution yourself, we would appreciate it if you could share it with the community. Thank you!
Views
Like
Replies
Views
Likes
Replies