custom user attributes

Vikas D 1 Reputation point
2021-12-08T06:40:01.96+00:00

Hello

I am looking for an api_endpoint from which I can get all user attributes (include custom and built-in attributes), I have gone through too many documents but did not find anything relevant to it.
I found below the endpoint in which user_attribute are coming but the custom attribute is still missing.
Request-Type:- GET
Request-Url:- https://graph.microsoft.com/v1.0/$metadata

I created the custom attribute from the azure portal itself, also grant all the API permission, and also enable the attribute on user_flow(not sure if it is required to enable in user_flow)

FYI

I also tried to create custom attributes through API,
Request-Type:- POST
Request-url:- https://graph.microsoft.com/v1.0/applications/{object_id}/extensionProperties
Authorization:- Bearer token
data-json:- {"name":"attribute_name","dataType":"string","targetObjects":["User"]}

By using API I am able to create the attribute and also able to update the value of it, but azure save the attribute with some extensions
"name": "extension_{client_d}_test_test_test_attribute" like this. and i did not want like this.
What I am looking for is to create custom attributes from the azure portal and get those attributes through api_endpoint.

Microsoft Security | Microsoft Graph
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. CarlZhao-MSFT 46,406 Reputation points
    2021-12-08T08:43:56.937+00:00

    Hi @Vikas D

    You can use the beta endpoint to list all attributes of a user, including your customized attributes.

    GET https://graph.microsoft.com/beta/users/{user-id}


    If the answer is helpful, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".
    Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.


Your answer

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