Deleting Outlook Contact Pictures

Copper Contributor

Hello,

I'm trying to delete the pictures of all contacts in a specific folder for all users with a python script.

I tried to "patch" empty data or delete with "requests.delete", but it doesn't work.

 

Is there really no way at the moment to achieve my goals or, is it simply unknown to me?

 

Code(with and without the "$value" at the end of the url):

 

headersphoto = { 
"Authorization": f"Bearer {access_token}", 
"Content-Type": "image/jpeg", 
} 

empty_payload = b"" 

responseKontaktePhoto = requests.patch( 
url=f"https://graph.microsoft.com/v1.0/users/{MailUser}/contactfolders/{parenFolderID}/childFolders/{childFolderID}/contacts/{ContactID}/photo/$value", 
data=empty_payload , 
headers=headersphoto, 
)

print(responseKontaktePhoto.status_code) 

 

I hope you can help me with my Problem. Thanks in advance.

 

0 Replies