List oauth2PermissionGrants
Namespace: microsoft.graph
Retrieve a list of oAuth2PermissionGrant entities, representing delegated permissions granted to the service principal (representing the client application) to access an API on behalf of a user.
Permissions
One of the following permissions is required to call this API. To learn more, including how to choose permissions, see Permissions.
Permission type | Permissions (from least to most privileged) |
---|---|
Delegated (work or school account) | Directory.Read.All, DelegatedPermissionGrant.ReadWrite.All, Directory.ReadWrite.All |
Delegated (personal Microsoft account) | Not supported. |
Application | Directory.Read.All, DelegatedPermissionGrant.ReadWrite.All, Directory.ReadWrite.All |
HTTP request
You can address the service principal using either its id or appId. id and appId are referred to as the Object ID and Application (Client) ID, respectively, in the Azure portal
GET /servicePrincipals/{id}/oauth2PermissionGrants
GET /servicePrincipals(appId='{appId}')/oauth2PermissionGrants
Optional query parameters
This method supports the OData query parameters to help customize the response.
Request headers
Name | Description |
---|---|
Authorization | Bearer {token}. Required. |
Request body
Do not supply a request body for this method.
Response
If successful, this method returns a 200 OK
response code and collection of oAuth2PermissionGrant objects in the response body.
Examples
Request
Here is an example of the request.
GET https://graph.microsoft.com/v1.0/servicePrincipals/00063ffc-54e9-405d-b8f3-56124728e051/oauth2PermissionGrants
Response
Here is an example of the response.
Note: The response object shown here might be shortened for readability.
HTTP/1.1 200 OK
Content-Type: application/json
Content-Length: 253
{
"value": [
{
"id": "id-value",
"clientId": "clientId-value",
"consentType": "consentType-value",
"principalId": "principalId-value",
"resourceId": "resourceId-value",
"scope": "scope-value"
}
]
}
Feedback
Submit and view feedback for