Skip to main content

Notifications

Customer Insights - Data forum
Answered

How to retrive segment members from CID segments via api

Posted on by 13
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? 
 
 
Categories:
  • Verified answer
    EQ-28052252-0 Profile Picture
    EQ-28052252-0 13 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
     

Helpful resources

Quick Links

Community Spotlight of the Month

Kudos to Mohamed Amine Mahmoudi!

Blog subscriptions now enabled!

Follow your favorite blogs

TechTalk: How Dataverse and Microsoft Fabric powers ...

Explore the latest advancements in data export and integration within ...

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 284,436 Super User

#2
Martin Dráb Profile Picture

Martin Dráb 225,206 Super User

#3
nmaenpaa Profile Picture

nmaenpaa 101,146

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans