Skip to content

Instantly share code, notes, and snippets.

@shemogumbe
Last active April 19, 2024 13:56
Show Gist options
  • Save shemogumbe/33690660d1ee59f4f77b3dadac7b57fc to your computer and use it in GitHub Desktop.
Save shemogumbe/33690660d1ee59f4f77b3dadac7b57fc to your computer and use it in GitHub Desktop.
Ability to delete user profile photo
'/users/{user-id}/photo/$value':
get:
tags:
- users.profilePhoto
summary: Get media content for the navigation property photo from users
externalDocs:
description: Find more info here
url: https://learn.microsoft.com/graph/api/profilephoto-get?view=graph-rest-1.0
operationId: user_GetPhotoContent
parameters:
- name: user-id
in: path
description: The unique identifier of user
required: true
style: simple
schema:
type: string
x-ms-docs-key-type: user
responses:
2XX:
description: Retrieved media content
content:
application/octet-stream:
schema:
type: string
format: binary
default:
$ref: '#/components/responses/error'
x-ms-docs-operation-type: operation
put:
tags:
- users.profilePhoto
summary: Update media content for the navigation property photo in users
operationId: user_SetPhotoContent
parameters:
- name: user-id
in: path
description: The unique identifier of user
required: true
style: simple
schema:
type: string
x-ms-docs-key-type: user
requestBody:
description: New media content.
content:
application/octet-stream:
schema:
type: string
format: binary
required: true
responses:
2XX:
description: Success
default:
$ref: '#/components/responses/error'
x-ms-docs-operation-type: operation
'/users/{user-id}/photos':
get:
tags:
- users.profilePhoto
summary: Get photos from users
description: The collection of the user's profile photos in different sizes. Read-only.
operationId: user_ListPhoto
parameters:
- name: user-id
in: path
description: The unique identifier of user
required: true
style: simple
schema:
type: string
x-ms-docs-key-type: user
- $ref: '#/components/parameters/top'
- $ref: '#/components/parameters/skip'
- $ref: '#/components/parameters/filter'
- name: $orderby
in: query
description: Order items by property values
style: form
explode: false
schema:
uniqueItems: true
type: array
items:
type: string
- name: $select
in: query
description: Select properties to be returned
style: form
explode: false
schema:
uniqueItems: true
type: array
items:
type: string
responses:
2XX:
$ref: '#/components/responses/microsoft.graph.profilePhotoCollectionResponse'
default:
$ref: '#/components/responses/error'
x-ms-pageable:
nextLinkName: '@odata.nextLink'
operationName: listMore
x-ms-docs-operation-type: operation
'/users/{user-id}/photos/{profilePhoto-id}':
get:
tags:
- users.profilePhoto
summary: Get photos from users
description: The collection of the user's profile photos in different sizes. Read-only.
operationId: user_GetPhoto
parameters:
- name: user-id
in: path
description: The unique identifier of user
required: true
style: simple
schema:
type: string
x-ms-docs-key-type: user
- name: profilePhoto-id
in: path
description: The unique identifier of profilePhoto
required: true
style: simple
schema:
type: string
x-ms-docs-key-type: profilePhoto
- name: $select
in: query
description: Select properties to be returned
style: form
explode: false
schema:
uniqueItems: true
type: array
items:
type: string
responses:
2XX:
description: Retrieved navigation property
content:
application/json:
schema:
$ref: '#/components/schemas/microsoft.graph.profilePhoto'
default:
$ref: '#/components/responses/error'
x-ms-docs-operation-type: operation
'/users/{user-id}/photos/{profilePhoto-id}/$value':
get:
tags:
- users.profilePhoto
summary: Get media content for the navigation property photos from users
operationId: user_GetPhotosContent
parameters:
- name: user-id
in: path
description: The unique identifier of user
required: true
style: simple
schema:
type: string
x-ms-docs-key-type: user
- name: profilePhoto-id
in: path
description: The unique identifier of profilePhoto
required: true
style: simple
schema:
type: string
x-ms-docs-key-type: profilePhoto
responses:
2XX:
description: Retrieved media content
content:
application/octet-stream:
schema:
type: string
format: binary
default:
$ref: '#/components/responses/error'
x-ms-docs-operation-type: operation
put:
tags:
- users.profilePhoto
summary: Update media content for the navigation property photos in users
operationId: user_SetPhotosContent
parameters:
- name: user-id
in: path
description: The unique identifier of user
required: true
style: simple
schema:
type: string
x-ms-docs-key-type: user
- name: profilePhoto-id
in: path
description: The unique identifier of profilePhoto
required: true
style: simple
schema:
type: string
x-ms-docs-key-type: profilePhoto
requestBody:
description: New media content.
content:
application/octet-stream:
schema:
type: string
format: binary
required: true
responses:
2XX:
description: Success
default:
$ref: '#/components/responses/error'
x-ms-docs-operation-type: operation
@shemogumbe
Copy link
Author

Neither '/users/{user-id}/photo/$value': or other paths that can be used as a workaround have delete method, they all have just get and put

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment