0

Azure's Graph API supports fetching details of a user using this API. It supports either the id or the userPrincipalName(UPN). For B2B user the requirement is to fetch the details using UPN. The UPN that Azure creates for a B2B user is the following format "B2BUserEmail#EXT#directoryid/Tenant"

When queried with above UPN format

https://graph.microsoft.com/v1.0/users/b2buseremail.com#EXT#@<directory/tenant>

the REST API fails and gives the following error

{ "error": { "code": "Request_ResourceNotFound", "message": "Resource 'b2buseremail.com' does not exist or one of its queried reference-property objects are not present.", "innerError": { "request-id": "d167220f-e0ef-4528-b7a5-de71fd524f07", "date": "2019-12-09T23:52:18" } } }

Prashant
  • 1,144
  • 8
  • 17
  • 28

1 Answers1

0

Currently Azure Graph API treats "#" as a special character and hence they have suggested to use "%23" instead of "#"

So the query would look like

https://graph.microsoft.com/v1.0/users/b2buseremail.com%23EXT%23@<directory/tenant>

Prashant
  • 1,144
  • 8
  • 17
  • 28