Skip to content Skip to sidebar Skip to footer

How To Write A Python Script To Authenticate To Azure Devops Rest Api And Get The Access Token?

How can I authenticate to Azure DevOps REST API in a python script? I found that there are 2 methods : Using personal access token (PAT) Using OAuth 2.0 I am using the second me

Solution 1:

The http error 203 indicates that the returned metainformation is not a definitive set of the object from a server with a copy of the object, but is from a private overlaid web. In your code,you added headers = {'Accept': 'application/json;api-version=1.0'}, but in fact the content type should be application/x-www-form-urlencoded.

You can use some OAuth2 library for python to authenticate to Azure DevOps REST API, such as OAuthLib. It includes sevelral samples.

Also, you can refer to following topic, hope it is helpful for you.

Tutorial for using requests_oauth2

Post a Comment for "How To Write A Python Script To Authenticate To Azure Devops Rest Api And Get The Access Token?"