error 401 when getting own profile

Vincent FUCHS 1 Reputation point
2022-03-28T07:04:40.97+00:00

Hi,

I generated a PAT to be able to call some Azure Devops APIs, and it was working quite well so far, to fetch a list of repositories from a project, or a file in a repository.

Now, following https://learn.microsoft.com/en-us/rest/api/azure/devops/profile/profiles/get?view=azure-devops-rest-7.1 , I need to retrieve my current user details . However, I get a 401.

I use the exact same config (with Postman for now) that works when fetching a file with this URL for instance :

https://dev.azure.com/{orgName}/{ProjName}/_apis/git/repositories/{repoName}/items?path=pom.xml&versionDescriptor.versionType=branch&versionDescriptor.version=main&api-version=7.1-preview.1&includeContentMetadata=true

same headers, same basic authentication with the PAT as username... it works to get a file, but not to get my profile, calling https://app.vssps.visualstudio.com/_apis/profile/profiles/me?api-version=7.1-preview.3

187300-image.png

Is there something obvious I am missing in the documentation or in my config ?

Not Monitored
Not Monitored
Tag not monitored by Microsoft.
38,619 questions
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. MayankBargali-MSFT 70,136 Reputation points
    2022-03-28T07:46:49.743+00:00

    Hi @VincentFUCHS-9136

    Welcome to Microsoft Q&A! Thanks for posting the question.

    DevOps is currently not supported in the Q&A forums, the supported products are listed over here https://learn.microsoft.com/en-us/answers/products (more to be added later on).
    You can ask the experts in the dedicated forum over here:
    https://stackoverflow.com/questions/tagged/devops
    https://developercommunity.visualstudio.com/spaces/21/index.html

    Please 'Accept as answer' and ‘Upvote’ if it helped so that it can help others in the community looking for help on similar topics.

    0 comments No comments

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.