Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

With access token get user details using REST API from Azure DevOps

Tags:

azure-devops

In our APP we have the user token for a user on Azure DevOps. We use this to perform certain actions in the Azure DevOps instance using REST APIs. In order to ignore webhooks triggered by actions performed by this particular user, we need to know the user's email. Is there an API that can provide that?

I tried the GET https://app.vssps.visualstudio.com/_apis/profile/profiles/{id}?api-version=5.1 with "me" in place of {id} as suggested by their documentation https://learn.microsoft.com/en-us/rest/api/azure/devops/profile/profiles/get?view=azure-devops-rest-5.1 but it throws "Resource cannot be found" error.

like image 532
Vikram Avatar asked Dec 05 '25 05:12

Vikram


1 Answers

The post is quite a time ago, but maybe my answer will help some other peoples. The docs are a bit confusing here. This url can be used:

https://vssps.dev.azure.com/{{organization}}/_apis/profile/profiles/me

I tested it successfully with a PAT (Secret of Basic Auth, Username empty).

like image 61
Boologne Avatar answered Dec 07 '25 22:12

Boologne



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!