
Hello,
We have a requirement of integrating external website (sitecore) and mobile app with CRM online . I have 3 questions related to this.
1)I have read that in order to call the web api of CRM online from external website e.g site core, the application has to be registered in Azure AD. But still we can connect through organization service class in C# without registering in Azure AD. The question is why azure token is a must in case of web api and not mandatory in case of organization service ? Also which is better option in the CRUD operations?
2)If web api is good enough, how can we prevent that external applications does not misuse the service e.g call service thousands of times to create useless records?
2) For development purpose, I tried to test D365 web api through postman but access is denied as still we don't have token in Azure. Any suggestion to skip this process?
Hi Ahmed, thanks for reaching out.
1. The web API is intended for improving integrations with any source code. However, using C# lets you access organization service which can authenticate with the SDK. Microsoft recommends all new development be created using the Web API, but they have also confirmed the organization service is supported and is redirected through the API on the back end by them, making it seamless to customers. If you are using C# my recommendation is to stick with organization service.
2. API abuse is monitored by Microsoft. They have limits and monitoring in place for you so you do not need to create that structure.
3. For testing web API you MUST have the token. The app must be registered and you need to obtain token from Azure AD by authenticating, then use that token when calling D365. When using postman you can use a different authentication which will prompt you for a login when running your connection. I find it easier to login to D365 and in the same browser open another tab where I paste my API URL call. Chromes is nice since there are plugins for chrome that will read and configure the JSON response for you.
I hope this helps. Have a great day!