UwU
UwU

Reputation: 23

How can I get the display name of an object in AzureAD using REST API if I have object ID?

After getting Keyvaults from Azure REST API, in the access policies there is an object ID which I guess is unique.
Can I use that object ID to get the display name from another REST API?

I found similar powershell command at powerShell-Azure but I need it to be done with a REST API.

Upvotes: 2

Views: 1358

Answers (1)

unknown
unknown

Reputation: 7483

You could request this API:

POST https://graph.microsoft.com/v1.0/directoryObjects/getByIds
Content-type: application/json

{
    "ids":["object-id1","object-id2"],
    "types":["user"]
}

Response:

enter image description here

For more details, see here.

Upvotes: 1

Related Questions