web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

No record found.

News and Announcements icon
Community site session details

Community site session details

Session Id :
Microsoft Dynamics CRM (Archived)

Dynamics Web API access to clients OR expose own API in Azure to fetch records from Dynamics CRM??

(0) ShareShare
ReportReport
Posted on by

Hi community!

I recently came up with the requirement of allowing some clients (I am supporting Dynamics 365 in my organization) to get some record data from my Dynamics 365 platform. They are currently using OData to fetch records from Dynamics, the cool thing is that any client no matter the type of program they are running can access the data by using OData queries. The problem is they can access more data than I wish (can be resolved by assigning security roles) and most importantly they are heavily dependent on changes made to entities and attributes. 

Yes, meaning today they could be fetching records from the Contact entity, let's say specifically grabbing FirstNameLastNameSocialSecurityNumber and PhoneNumber attributes. If in the near future I decided to stop supporting the SocialSecurityNumber field and created a new one called "SocialSecurityNumber_Tokenized", I would have to let know my clients to modify their programs to now fetch the correct field. This implies changes to every client program consuming these records, which means code changes on their end, re-testing, developers getting mad, etc.. So this is when I came up with the idea of having an API in Azure which my clients can hit and obtain the records. Instead of having them write these ODataqueries, I would build an API that fetches these records. They would only have to hit the following method via HTTPS (sample) "fakeApi/api/myApi/GetContactData" which will return the records with attributes I choose to return in a nice JSON format response. 

I see many benefits on implementing this solution, overall the most important one would be that any changes in my entities (database) would not affect my clients since any changes would be updated as well in my API, loosely couple integration will be achieved :). 

What are your thoughts?

Change is the only constant...

*This post is locked for comments

I have the same question (0)
  • Suggested answer
    Nuno Profile Picture
    2,005 on at

    Hi Emilio,

     

    Beyond developing an API for fetching records (which is really a good solution) you can also achieve a loosely couple integration using crm actions. Instead of querying directly the contact record, it would be executed the crm action via Web API.

    https://msdn.microsoft.com/en-us/library/mt607600.aspx#bkmk_customActions

    The action:

    So, let's consider you have an output attribute named xpto and in the future you want the change the value provided in this attribute, you only have to update the action on CRM.

    If you follow the strategy of developing an API for fetching record, you also would not need to change the client code you consumes your API, but it would be required to update your API, and updating an action in CRM is perhaps simpler than updating an API.

  • Suggested answer
    Aric Levin - MVP Profile Picture
    30,190 Moderator on at

    Hi Emilio,

    Not sure if you have previously developed an API in Azure, but the process is pretty straight forward and not too complex, especially if you are doing this with Visual Studio, which will build the project and publish it to Azure easily.

    The only thing you will be left to do is calling the CRM WebAPIs from your Azure API.

    We have done a similar implementation for SharePoint, where the consumers of the Azure API could be CRM or other applications, so I don't foresee any downsides to this. Of course with changes to CRM, you would have to modify the Azure API as well, but that would have to happen regardless which approach you would take.

    Hope this helps.

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

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Stars!

Meet the Microsoft Dynamics 365 Contact Center Champions

We are thrilled to have these Champions in our Community!

Congratulations to the March Top 10 Community Leaders

These are the community rock stars!

Leaderboard > 🔒一 Microsoft Dynamics CRM (Archived)

#1
JS-09031509-0 Profile Picture

JS-09031509-0 3

#2
AS-17030037-0 Profile Picture

AS-17030037-0 2

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans