Skip to content

Instantly share code, notes, and snippets.

View shemogumbe's full-sized avatar
🏠
Working from home

Shem Ogumbe shemogumbe

🏠
Working from home
View GitHub Profile
@shemogumbe
shemogumbe / group_photo.yml
Created April 19, 2024 14:01
Ability to delete group photo
'/groups/{group-id}/photo/$value':
get:
tags:
- groups.profilePhoto
summary: Get media content for the navigation property photo from groups
operationId: group_GetPhotoContent
parameters:
- name: group-id
in: path
description: The unique identifier of group
@shemogumbe
shemogumbe / user_photo_value.yml
Created April 19, 2024 13:47
Lacking ability to delete user photo -
'/users/{user-id}/photo/$value':
description: Provides operations to manage the media for the user entity.
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: users.GetPhotoContent
@shemogumbe
shemogumbe / delete_user_photo.yml
Last active April 19, 2024 13:56
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:
@shemogumbe
shemogumbe / delete_profile_picture.py
Created April 19, 2024 13:01
Delete profile picture
import requests
# Endpoint URL
url = "https://graph.microsoft.com/v1.0/me/photo/$value"
# Token (replace with your actual token)
token = "<your-token-here>"
# Headers
headers = {
@shemogumbe
shemogumbe / upload_profile_photo.py
Created April 19, 2024 12:57
Upload a profile phto for a user
import requests
# Read binary data from file
with open("binary_img.txt", "rb") as f:
binary_data = f.read()
# Endpoint URL
url = "https://graph.microsoft.com/v1.0/me/photo/$value"
# Token (replace with your actual token)