Forum Discussion
JBergqvist
Feb 19, 2020Brass Contributor
What happened to the group/teams photo endpoint in graph api? Not fetching photos
Hi Guys!
I have developed a solution that lists groups and teams with their basic information and photo.
This has worked for years in different forms against the graph api endpoint:
https://graph.microsoft.com/v1.0/groups/{id}/photo/$value
However: Before I have been able to fetch the photo for all groups and teams regardless of membership in the team.
But then, One week ago I started to notice that all the teams that was defined as private and I was not a member of resulted in a 404 error:
{
"error": {
"code": "ErrorItemNotFound",
"message": "The photo wasn't found.",
"innerError": {
"request-id": "e36d0132-aa37-4f7f-a110-03bc4e6b71d0",
"date": "2020-02-19T09:15:28"
}
}
}
The behaviour is reproduced in several tenants and the permission level for API is Groups.ReadWrite.All
I have tried to find any information about this change, have Microsoft done changes for this API endpoint? And if so, why?
If someone has any similar experiences and/or some information that I have missed out on you are more than welcome to help me out 🙂
Thank you, Johan
- Ravi KoreCopper Contributor
Even after granting the permissions Groups.Read.All & TeamsSettings.Read.All and tried both Delegated & App permissions but still same error "Photo Wasn't Found" .
- Gousia_Begum
Microsoft
JBergqvist We could not repro the issue on our side. I tried getting the photo using the api you tried and it works fine for me. Could you please confirm if the group, you are trying actually has a photo?
- JBergqvistBrass ContributorHi Gousia! Thank you for your reply.
Yes the team has a photo.
The code works when you are a member of the team but not otherwise.
So its obviously a permission issue. But this is not how things have worked before.
Can you confirm, are you able to load photos for teams that you are not a member of?
Kind regards, johan- Gousia_Begum
Microsoft
JBergqvist You can fetch the photo of the team only if you are a member of that team because it is based on Delegated permissions. Did you try this in Graph Explorer earlier?