restazure-devops-rest-apiazure-devops-server-2022

find user by name or email on Azure DevOps Server 2022.1


I just realized we had new and old servers, so on old ones, how can I find a user ?

I keep getting the same error even if I provide the proper parameters

https://[serverurl]/_apis/identities?api-version=6.0&searchFactor=name&factorValue=[myname]

I get that message every time

Either descriptors, subject descriptors or social descriptors or identityIds or searchFactor/factorValue must be specified


Solution

  • According to the Identities - Read Identities REST API, the correct URI Parameters are filterValue and searchFilter, not searchFactor and factorValue.

    The searchFilter values can be AccountName (domain\alias), DisplayName, MailAddress, General (display name, account name, or unique name), or LocalGroupName (only search Azure Devops groups).

    To search a user by name,

    GET https://[serverurl]/_apis/identities?searchFilter=General&filterValue=username&api-version=6.0
    

    Test result:

    result

    You can check more examples here.