This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 = { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
'/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: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
'/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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
'/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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
using System.Threading.Tasks; | |
using Azure.Identity; | |
using Microsoft.Graph; | |
using Microsoft.Extensions.Configuration; | |
using DotNetEnv; | |
using System.Reflection; | |
using Microsoft.Graph.Models; | |