cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Rembis
New Member

Set group image for SP with API fails

Hello,

 

I am trying to change the image of a group by using the REST api for sharepoint.

 

My code fails with the error:

{"odata.error":{"code":"-1, System.Net.WebException","message":{"lang":"en-US","value":"The remote server returned an error: (404) Not Found."}}}
clientRequestId: bdf455c1-da25-433c-9f7a-bf98f0744e59
serviceRequestId: cd4adf9f-006d-3000-1ebd-6cca461ee9f5

 

Below an image about how i builded the request:

 

code.png

 

Is there someone that can help me? I Can't find any solution. I am running another flow where a team is created and i really want to change the picture to the company's logo.

 

Thank you 🙂

 

1 REPLY 1
Expiscornovus
Super User
Super User

Hi @Rembis,

 

What kind of group are you trying to update. A SharePoint Group or a Office 365 Group?

 

If it is the second you could try and use the Graph API instead with an HTTP action and a PUT request:

https://docs.microsoft.com/en-us/graph/api/profilephoto-update?view=graph-rest-beta&tabs=http

 

PUT https://graph.microsoft.com/groups/{id}/photo/$value
Content-type: image/jpeg

Binary data for the image

 

Helpful resources

Announcements
UG GA Amplification 768x460.png

Launching new user group features

Learn how to create your own user groups today!

Community Connections 768x460.jpg

Community & How To Videos

Check out the new Power Platform Community Connections gallery!

M365 768x460.jpg

Microsoft 365 Collaboration Conference | December 7–9, 2021

Join us, in-person, December 7–9 in Las Vegas, for the largest gathering of the Microsoft community in the world.

Users online (2,073)