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

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :
Customer experience | Sales, Customer Insights,...
Suggested Answer

Solution Approach To Handle Integration With 3rd Party Application

(0) ShareShare
ReportReport
Posted on by 60

Hi Folks,

I have a business requirement where 3rd party wants to access Active records(not deactivated) from custom entity in dynamics CRM.

3rd party want to use Dynamics 365 REST API directly.

Can you please suggest what will the technical approach to fulfill this requirement? Should I need to write WEB API to achieve this or dynamics app registration in azure will be enough.

Kindly suggest me what will the best approach to complete this requirement.

I have the same question (0)
  • Suggested answer
    Bipin D365 Profile Picture
    28,983 Moderator on at

    Hi,

    There are multiple approach to your requirement.

    1. 3rd party system could use CRM OOB Web api

    For this to work, The first thing you have to do is to register application azure AD and copy client ID and Client Secret which will be used by 3rd party system to generate Access token.

    Next you have to provide API permission in Azure AD registered Application. CRM Online Delegate permission will do. Next create Application user in crm and reuse application ID which you have copied.

    Create Custom security role and provide basic privilege and assign this security role to application user.

    Share Web API URI with 3rd party system including Client ID, Client Secret, Tenant ID and they should be able to access custom entity activated records.

    2. Create Azure function to expose CRM Data in case you don't want 3rd party system to directly be accessing your CRM

    Azure function is lightweight service and can be easily create and deployed from VS. Write your code to connect to CRM and fetch required data and return those data in CRM.

    See below link for sample code to perform operation using C# WEB API.

    https://github.com/jlattimer/CrmWebApiCSharp

    If found helpful, Please mark my answer verified.

  • shashanksaxenaNTT Profile Picture
    60 on at

    Hi Bipin,

    Thanks for your response.

    If I go with approach 1 , then how can I prevent 3rd party from accessing "Deactivated" records in custom entity , my understanding is that if I will give basic read access on entity then also 3rd party will be able to see both Activated and Deactivated records.

    Strict condition is, then i don't want to allow 3rd party to access Deactivated records in custom entity.

  • Suggested answer
    Kumar Viju Profile Picture
    1,026 on at

    https://www.powerobjects.com/blog/2018/05/18/authentication-dynamics-365-using-azure-apps/

    The above sample works pretty well. I have tested it in my console apps and used it in prod with modifications.

  • Suggested answer
    Bipin D365 Profile Picture
    28,983 Moderator on at

    Hi,

    We can add filter in web api to only fetch active record. Use statecode and statuscode field to apply filter.

    /api/data/v9.1/accounts?$filter=statecode eq 0

    Relace accounts with your custom entity name.

    If found helpful, Please mark my answer verified.

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

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Neeraj Kumar – Community Spotlight

We are honored to recognize Neeraj Kumar as our Community Spotlight honoree for…

Leaderboard > Customer experience | Sales, Customer Insights, CRM

#1
Tom_Gioielli Profile Picture

Tom_Gioielli 171 Super User 2025 Season 2

#2
#ManoVerse Profile Picture

#ManoVerse 83

#3
Jimmy Passeti Profile Picture

Jimmy Passeti 50 Most Valuable Professional

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans