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 :
Small and medium business | Business Central, N...
Suggested Answer

Connect Custom BC API To Python

(0) ShareShare
ReportReport
Posted on by 4
Hello, I am trying to connect a custom BC API which I added in Web Services, and access the information using a GET request in Python. 
 
Here in my Python code
 
import requestsfrom requests.auth import HTTPBasicAuthimport jsonr = requests.get(URL,auth=HTTPBasicAuth(uid,pwd))#Display Infoprint(r.headers)print(r.text)
 
However i'm getting the error that I need to use OAuth; how would I implement OAuth in this code to Authenticate my request and access my custom BC APi?
 
Any help is appreciated. 
I have the same question (0)
  • ArshiaSistan Profile Picture
    4 on at
    Im not sure what happend to the code formatting in the Original Post 
     
    import requests
    from requests.auth import HTTPBasicAuth
    import json
    r = requests.get(URL,auth=HTTPBasicAuth(uid,pwd))
     
    #Display Info
    print(r.headers)
    print(r.text)
  • Suggested answer
    YUN ZHU Profile Picture
    95,381 Super User 2025 Season 2 on at
    Hi, hope the following helps.
     
    Thanks.
    ZHU

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 > Small and medium business | Business Central, NAV, RMS

#1
OussamaSabbouh Profile Picture

OussamaSabbouh 2,990

#2
Jainam M. Kothari Profile Picture

Jainam M. Kothari 1,576 Super User 2025 Season 2

#3
YUN ZHU Profile Picture

YUN ZHU 1,028 Super User 2025 Season 2

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans