事件
Delete profilePhoto
Namespace: microsoft.graph
Delete the photo for the signed-in user or the specified group.
備註
The delete operation supports only user or group photos, but not Outlook contact nor Teams photos.
This API is available in the following national cloud deployments.
Global service | US Government L4 | US Government L5 (DOD) | China operated by 21Vianet |
---|---|---|---|
✅ | ✅ | ✅ | ✅ |
The following tables show the least privileged permission or permissions required to call this API on each supported resource type. Follow best practices to request least privileged permissions. For details about delegated and application permissions, see Permission types. To learn more about these permissions, see the permissions reference.
Permission type | Least privileged permissions | Higher privileged permissions |
---|---|---|
Delegated (work or school account) | ProfilePhoto.ReadWrite.All | User.ReadWrite, User.ReadWrite.All |
Delegated (personal Microsoft account) | User.ReadWrite | Not supported. |
Application | ProfilePhoto.ReadWrite.All | User.ReadWrite.All |
Permission type | Least privileged permissions | Higher privileged permissions |
---|---|---|
Delegated (work or school account) | ProfilePhoto.ReadWrite.All | Group.ReadWrite.All |
Delegated (personal Microsoft account) | Not supported. | Not supported. |
Application | ProfilePhoto.ReadWrite.All | Group.ReadWrite.All |
備註
- Global admins, User admins, and People admins can delete the photo of any user in the organization using delegated permissions. This operation also supports application permissions. Deleting the photo of any user in the organization requires ProfilePhoto.ReadWrite.All or User.ReadWrite.All permissions. Deleting the photo of the signed-in user only requires User.ReadWrite permissions.
To delete a user's profile photo:
DELETE /me/photo/$value
DELETE /users/{id | userPrincipalName}/photo/$value
To delete a group photo:
DELETE /groups/{id}/photo/$value
Header | Value |
---|---|
Authorization | Bearer {token}. Required. Learn more about authentication and authorization. |
Don't supply a request body for this method.
If successful, this method returns a 200 OK
response code.
The following example shows a request.
DELETE https://graph.microsoft.com/v1.0/me/photo/$value
The following example shows the response.
HTTP/1.1 200 OK