Forum Discussion
Not Getting Data from Graph rest api for MS Team
Hi hidayat3676, To list joined teams for user you need application level permissions. Please go through this https://docs.microsoft.com/en-us/graph/api/user-list-joinedteams?view=graph-rest-1.0&tabs=http#permissionsfor more details.
GET https://graph.microsoft.com/v1.0/users/{id}/joinedTeams
and to https://docs.microsoft.com/en-us/graph/api/channel-list?view=graph-rest-1.0&tabs=http using graph API use
GET https://graph.microsoft.com/v1.0/teams/{team-id}/channels
Mamatha-MSFT Hi,
Thanks for your response
I already have these permission you can see in the image attach, plus what about my first api teams api which return empty data ?
- Mamatha-MSFTApr 23, 2021Former Employee
Hi hidayat3676, I have gone through your screenshot but few permissions are missing.
TeamSettings.Read.All, TeamSettings.ReadWrite.All, User.Read.All, User.ReadWrite.All, Directory.ReadWrite.All
Please make sure to add these permissions and let us know if the issue still persists.
and Get https://graph.microsoft.com/v1.0/teams is not a valid request.- hidayat3676Apr 25, 2021Copper Contributor
Hi Mamatha-MSFT ,
I 've added these permissions but still no luck
firstly is it necessary to add write permission for resources that i only want to read?
2nd if Get https://graph.microsoft.com/v1.0/teams is invalid why it return 200 ok?
3rd no endpoint except /users, /users/{id}, /me working for me when i used post request for create a resource it return 405 and when use GET it either return empty data in some end point and on others it return 404.
Can you please explain this?
See Attached Images for reference.
Thanks
- Mamatha-MSFTApr 26, 2021Former Employee
Hi hidayat3676, To get team you need to append team-id for your request. Please go through this https://docs.microsoft.com/en-us/graph/api/team-get?view=graph-rest-1.0&tabs=http#example.
GET https://graph.microsoft.com/v1.0/teams/{teams-id}
For GET https://graph.microsoft.com/v1.0/me/joinedTeams can you please share the error screenshot.
As per your postman screenshot your trying to create a group using POST https://graph.microsoft.com/v1.0/groups. I think you don't have required permissions to create a group (Group.Create, Group.ReadWrite.All, Directory.ReadWrite.All). Please go through this https://docs.microsoft.com/en-us/graph/api/group-post-groups?view=graph-rest-1.0&tabs=http#examples to create a group.
Could you please specify what exactly you want to get. So that I can guide you.