Skip to main content

Notifications

Customer experience | Sales, Customer Insights,...
Answered

How to retrive segment members from CID segments via api

Posted on by 17
Hi, have you ever tested this endpoint to retrieve segment membres from CID?  : {serviceRoot}/data/Customer?select=*&$filter=IsMemberOfSegment('{SegmentName}')&$top=10 from this walkthrough   https://learn.microsoft.com/en-us/dynamics365/customer-insights/data/odata-examples#customer.
 
I tried from this page https://developer.ci.ai.dynamics.com/api-details#api=CustomerInsights however it seems it is not available in the list, Do I need to create my own app to be able to test it out? 
 
 
  • Verified answer
    EQ-28052252-0 Profile Picture
    EQ-28052252-0 17 on at
    How to retrive segment members from CID segments via api
    Hi Dengliang Li, thank you for your reply it is super helpful and it is part of the solution to have the correct headers and the code example (thank you so much for that :) ), however,  I was actually looking for the specific operation to test this endpoint [{serviceRoot}/data/Customer?select=*&$filter=IsMemberOfSegment('{SegmentName}')&$top=10 ] and got some extra help to know that I can use the "GetEntityByODataQuery" operation to set that endpoint as the relative path and be able to test it out.
     
     
     
     
    Thanks!
  • Dengliang Li Profile Picture
    Dengliang Li Microsoft Employee on at
    How to retrive segment members from CID segments via api
    Hi,
     
    Has the issue been solved?
    Have there been any updates? Please feel free to ask me if you have any questions!
    If it has been resolved, can you mark the response as an answer?
     
  • Suggested answer
    Dengliang Li Profile Picture
    Dengliang Li Microsoft Employee on at
    How to retrive segment members from CID segments via api
    Hi,
     
    According to this document, you would first need to enable Allow API Access in the CID instance.
    Work with Customer Insights - Data APIs - Dynamics 365 Customer Insights | Microsoft Learn
     
    Then use ListAllInstancesAPI to get the current instance ID.
     
    After that, you can get the segmentation membership information by building an XMLHTTPRequest.
    The code is below.
     
    Two request headers Ocp-Apim-Subscription-Key and Authorization need to be set. and their values can be found here.
     
    If my answer was helpful, please click Like, and if it solved your problem, please mark it as verified to help other community members find more.
    If you have further questions, please feel free to contact me .
     
    Best Regards,
    Dengliang Li
     

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

November Spotlight Star - Khushbu Rajvi

Congratulations to a top community star!

Forum Structure Changes Coming on 11/8!

In our never-ending quest to help the Dynamics 365 Community members get answers faster …

Dynamics 365 Community Platform update – Oct 28

Welcome to the next edition of the Community Platform Update. This is a status …

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 290,900 Super User 2024 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 229,275 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans