Skip to main content

Notifications

Customer Service forum

Need help on get contacts API

Posted on by Microsoft Employee

Hello All members,

I am working on one mobile application(both iOS and Android in native code). In this there is functionality of login with Dynamics 365 and get contacts from it. In this I have used OAUTH2.0 library to implement login functionality. Login is working fine. Next, I want to fetch contacts from Dynamics 365 using API. So I am following below documentation link:
https://docs.microsoft.com/en-us/dynamics365/customer-engagement/web-api/contact?view=dynamics-ce-odata-9

In mobile app, I am not getting any responce when I call this API. Also there is no error. 

When I try to call [organization URI]/api/data/v9.0/contacts from my computer browser then it gives me contacts after login.
So can you please help me regarding do I need to pass any token/authorizationCode/header parameters etc while calling this API from mobile app? In documentation they didn't mentioned anything regarding which things I need to pass while calling contact API. 

Also I am not sure if I must have to use its mobile SDK to implement this feature rather then normal API call?

Thanks in advance.

  • Community Member Profile Picture
    Community Member Microsoft Employee on at
    RE: Need help on get contacts API

    Hello @Dharani, Thanks for your reply. I checked the links you shared but its in different technology, so I am not able to understand it well. So I am now trying it with POSTMAN collection. Please check my last comment I added. So you will have better idea regarding my issue and error.

  • Community Member Profile Picture
    Community Member Microsoft Employee on at
    RE: Need help on get contacts API

    Hello @Terrance, thanks for the help. Yes I seen this code but its in C# and I am iOS mobile developer so not able to execute it in C#.

    I am trying to call get contacts API in postman using the way mentioned in documentation but I am getting webpage code in response. If API will star working in postman then I can easily integrate it in my iOS app.

    I am referring this link for postman setup: docs.microsoft.com/.../setup-postman-environment

    This is screenshot of my postman collection error: https://tinyurl.com/y5k6pm47

    This is screenshot of variables I set in postman: https://tinyurl.com/y68z6zbm

    So can you please help me to execute this get contact API in postman. I am not sure if I am passing wrong value of any parameter or the issue is something different.

  • Terrance Morgan Profile Picture
    Terrance Morgan 515 on at
    RE: Need help on get contacts API

    You can also refer the following links, a bit add-on to Dharanidharan's answer.

    https://msdn.microsoft.com/en-us/library/mt742432.aspx

    https://jlattimer.blogspot.my/2015/11/crm-web-api-using-c.html

    --
    Terrance
    CRM Admin | Microsoft 365 E5

  • Dharanidharan Profile Picture
    Dharanidharan 390 User Group Leader on at
    RE: Need help on get contacts API

    The key difference lies in authentication. When we use scripts and execute from within Dynamics CRM using webresources, the authentication is automatically passed and we do not have to supply the authentication token header there.

    But when we are connecting from outside of CRM context, it is important to authenticate the access credentials before they can connect and perform actions in Dynamics CRM.

    Please refer the below link. It will help you to understand how we need to authenticate the CRM using the access token.

    https://community.dynamics.com/crm/b/crminogic/posts/programming-using-webapi-through-c-in-dynamics-crm-2016

    Regards,

    Dharani

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

News and Announcements

Give Back to the Community this Month

Quick Links

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,807 Super User 2024 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 229,135 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans