So, from what I see from most sources, they say if youre trying to make a python program call azure devops api calls, it uses a python import statement such as :
Surely, it is supported to use requests
to call Azure DevOps REST API
Firstly, you need to create a personal access token (PAT)
Then you can use the PAT to create the basic auth header, and make the request:
import requests
import base64
pat = 'tcd******************************tnq'
authorization = str(base64.b64encode(bytes(':'+pat, 'ascii')), 'ascii')
headers = {
'Accept': 'application/json',
'Authorization': 'Basic '+authorization
}
response = requests.get(
url="https://dev.azure.com/jack0503/_apis/projects?api-version=5.1", headers=headers)
print(response.text)