How to use $expand while making microsoft API call?

Shambhavi Rai 101 Reputation points
2021-05-12T07:35:48.233+00:00

I am trying to get all servicePrincipals for a tenant using this API call, I want to expand it to get ServicePrincipals role assignment, I am using the following GET request but I am not getting the required response.

https://graph.microsoft.com/v1.0/servicePrincipals/?$expand

How do I check which all fields the API can return using expand?

This is the API link
https://learn.microsoft.com/en-us/graph/api/serviceprincipal-list?view=graph-rest-1.0&tabs=http

Microsoft Security Microsoft Entra Microsoft Entra ID
0 comments No comments
{count} votes

Accepted answer
  1. Vasil Michev 119.5K Reputation points MVP Volunteer Moderator
    2021-05-12T09:41:35.647+00:00

    You need to specify the property to expand on. Here's an example for your scenario:

    https://graph.microsoft.com/beta/servicePrincipals?$top=999&$filter=tags/any(t:t eq 'WindowsAzureActiveDirectoryIntegratedApp')&$expand=appRoleAssignments

    2 people found this answer helpful.
    0 comments No comments

0 additional answers

Sort by: Most helpful

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.