Skip to main content

Notifications

Announcements

No record found.

Dynamics 365 general forum
Suggested answer

Appropriate Dynamics 365 API URL to find the system user along with associated contacts

Posted on by 5

I've been looking for an API endpoint in Dynamics365 API which provides us with the SystemUser along with their associated Contacts. Please redirect me to an appropriate documentation. 

For ex. EmailID xyz@abc.com should be the input parameter of the API and this endpoint should return all the contacts associated with it.

  • Suggested answer
    Bipin D365 Profile Picture
    Bipin D365 28,960 Super User on at
    RE: Appropriate Dynamics 365 API URL to find the system user along with associated contacts

    Hello,

    Please use below endpoint for your requirement -

    org50b8451e.crm8.dynamics.com/.../contacts eq 0 and Microsoft.Dynamics.CRM.EqualUserId(PropertyName='ownerid'))

    Replace instance url with your crm instance url.

    Please mark my answer verified if this is helpful!

    Regards,

    Bipin Kumar

    Follow my Blog: xrmdynamicscrm.wordpress.com/

  • Suggested answer
    Guido Preite Profile Picture
    Guido Preite 54,057 Super User on at
    RE: Appropriate Dynamics 365 API URL to find the system user along with associated contacts

    Dynamics can be queried using IOrganizationService or the Web API endpoint, here a docs page regarding Web API:

    https://docs.microsoft.com/en-us/powerapps/developer/data-platform/webapi/overview

    to create the Web API queries you can use my tool Dataverse REST Builder (link in my signature), if you need to use IOrganizationService (usually with the official C# SDK) there are plenty of examples like blog posts and videos on how to use the CrmServiceClient object

  • Dynamics365 API Profile Picture
    Dynamics365 API 5 on at
    RE: Appropriate Dynamics 365 API URL to find the system user along with associated contacts

    Hey Steve,

    I was looking for a API endpoint that would give me the list of active contacts associated with the system user.

    From the UI the page looks like this, although in this case it is empty for other accounts it shows a list of contacts. I was looking for an endpoint to return this same data from API.

    pastedimage1646829646946v2.png

  • Suggested answer
    Community Member Profile Picture
    Community Member Microsoft Employee on at
    RE: Appropriate Dynamics 365 API URL to find the system user along with associated contacts

    Hi Dynamics365 API,

    If you think my answer help you, please verity it. Thanks a lot.

    Screenshot-2022_2D00_03_2D00_09-152235.png

    If you have any other doubt related to this issue, feel free to ask.

  • Suggested answer
    Community Member Profile Picture
    Community Member Microsoft Employee on at
    RE: Appropriate Dynamics 365 API URL to find the system user along with associated contacts

    Hi Dynamics365 API,

    I'm not sure what's their associated Contacts mean, the Contacts  created by the User or the Contacts' owner? But I think $expand could do this. Below this is the URL which gets the users filtered by Email along with the contacts whose owner is him.

    var url = "https://xxxx.crm.dynamics.com/api/data/v9.2/systemusers?$select=fullname&$filter=internalemailaddress eq '"   email_address   "'&$expand=contact_owning_user($select=fullname)";
     

    Reference:

    Retrieve a table row using the Web API (Microsoft Dataverse) - Power Apps | Microsoft Docs

    systemuser EntityType (Microsoft.Dynamics.CRM) | Microsoft Docs

Helpful resources

Quick Links

Replay now available! Dynamics 365 Community Call (CRM Edition)

Catch up on the first D365 Community Call held on 7/10

Community Spotlight of the Month

Kudos to Saurav Dhyani!

Congratulations to the June Top 10 community leaders!

These stars go above and beyond . . .

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 288,768 Super User

#2
Martin Dráb Profile Picture

Martin Dráb 225,985 Super User

#3
nmaenpaa Profile Picture

nmaenpaa 101,148

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans