Skip to main content

Notifications

Announcements

No record found.

Customer experience | Sales, Customer Insights,...
Suggested answer

How to authenticate with D365 to send GET requests from Python scripts

Posted on by 5

I am trying to write python scripts to get info from our CRM. I get lots of 401 responses when I try to pass my credentials. 

How do I create tokens (with the client ID and secret) using Python and what would a Python script look like that creates a token and sends a GET request to get our CRM incidents? 

Thank you!

  • Suggested answer
    RE: How to authenticate with D365 to send GET requests from Python scripts

    Hello,

    In order to authenticate with Dynamics, you first need to register an application in Azure, to obtain your authentication token from.

    This article explains how to achieve that:

    community.dynamics.com/.../register-dynamics-crm-app-with-azure-for-oauth-2-0-authentication

    After obtaining the Client Id from the Azure App, you can build a request that gets the authentication token from Azure and starts performing your requests.

    The following article goes over how to do this via Python:

    alexanderdevelopment.net/.../

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

#2
Martin Dráb Profile Picture

Martin Dráb 230,188 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans