Is it possible to get a list of all the organizations a user is allocated to, via the Azure DevOps REST API's?
From what I can see, the REST API's are organization specific.
You can get the list of organization using Azure DevOps REST APIs
First get the profile of logged in user https://learn.microsoft.com/en-us/rest/api/azure/devops/profile/profiles/get?view=azure-devops-rest-6.0 if you are using OAuth authentication, use
API
GET https://app.vssps.visualstudio.com/_apis/profile/profiles/me?api-version=6.0
Response
{ "displayName": "User Name", "publicAlias": "67861230-823749-915c-887ed4ccf1f1", "emailAddress": "[email protected]", "coreRevision": 7678234, "timeStamp": "2018-12-15T02:06:10.2750402+00:00", "id": "67861230-823749-915c-887ed4ccf1f1", "revision": 7678234 }
Use publicAlias
to get the list of organization https://learn.microsoft.com/en-us/rest/api/azure/devops/account/accounts/list?view=azure-devops-rest-6.0
API https://app.vssps.visualstudio.com/_apis/accounts?memberId={publicAlias}&api-version=6.0
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With