Skip to main content

Notifications

Announcements

No record found.

Microsoft Dynamics CRM (Archived)

connecting to dynamic crm 365 online via API

Posted on by 5

Hi there,

I realize this question has been asked already in some other forms but I have some clarifications needed.

So, what we have is a Dynamic CRM online account with leads, contacts, etc. and we would like to perform CRUD operations on the CRM from a Drupal installation, we want to post some data to the CRM when a certain interaction happens on the site.

What seems to be clear from resources on the web is that the correct and more secure way is to access is via AZURE AD by requesting a token, we manage to get the token

but then we get a 401 error when we use the token to retrieve data ( using POSTMAN )

Is it the best way to use AZURE AD?

Can we use custom code ( with curl for example ) to login and access the data or do we have to use ADAL? we want to connect from a Drupal backend is it possible? is there a library for that?

stupid question: we don't have to use implicit login right? that's only if we want the user to be prompted to login right?

I use this URL login.microsoftonline.com/{{tenant}}/oauth2/v2.0/token to get the token {{tenant}} is the tenant ID ofcourse.

the request is made here https://<tenant-name>.api.crm4.dynamics.com/api/data/v9.1/leads with the authorization header : Bearer <token> 

thanx in advance 

*This post is locked for comments

  • Suggested answer
    Guido Preite Profile Picture
    Guido Preite 54,081 Super User 2024 Season 1 on at
    RE: connecting to dynamic crm 365 online via API

    Drupal uses PHP, check if this library can help you

    https://github.com/AlexaCRM/dynamics-webapi-toolkit

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

December Spotlight Star - Muhammad Affan

Congratulations to a top community star!

Top 10 leaders for November!

Congratulations to our November super stars!

Tips for Writing Effective Suggested Answers

Best practices for providing successful forum answers ✍️

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 291,269 Super User 2024 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 230,198 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans