简体   繁体   中英

error using azure devops api for python “API resource location is not registered”

I want to extract users list from azure devOps using python but an error appears:

ValueError: API resource location 229a6a53-b428-4ffb-a835-e8f36b5b4b1e is not registered on https://vssps.dev.azure.com/(my Organization).

I have already tried to extract the projects list and it works fine.

here is my code:

from azure.devops.connection import Connection
from msrest.authentication import BasicAuthentication


personal_access_token = 'my personal access token'
organization_url = 'https://dev.azure.com/(my Organization)'

credentials = BasicAuthentication('', personal_access_token)
connection = Connection(base_url=organization_url, creds=credentials)

accounts_client = connection.clients_v5_1.get_accounts_client()
get_acc = accounts_client.get_accounts()

for acc in get_acc:
    print(acc)

btw I need to get information about the last access and date created account so maybe another method?

There is a call in Azure DevOps API called "User Entitlements - Get User Entitlements" with documentation here

It provides a list of users for a specific project with details like lastAccessDate and dateCreated.

Is this something you find useful?

There was a bug in API, it's fixed now

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM