Forum Discussion
Not Getting Data from Graph rest api for MS Team
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
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.
- hidayat3676Apr 26, 2021Copper Contributor
Mamatha-MSFT
Thanks for your response
I already have attached my permission list ss.
Actually I'm developing a Saas based app, I want to get all teams of the organization or the account that install my app, their groups, channels, chats, installed apps and all users
Response For GET https://graph.microsoft.com/v1.0/me/joinedTeams
{
"error": {
"code": "ResourceNotFound",
"message": "Resource not found.",
"innerError": {
"date": "2021-04-26T08:18:32",
"request-id": "2264149e-2352-4d72-9dae-b22e09f1be52",
"client-request-id": "2264149e-2352-4d72-9dae-b22e09f1be52"
}
}
}
I've teams and channels in my account.
Please Guide me about how can i get the above data?
Thanks.- Mamatha-MSFTApr 27, 2021Former Employee
Hi hidayat3676 Please follow these steps to get List joinedTeams
1. Add required permissions to get List joinedTeams
2. Get Access Token3. get List joinedTeams using GET https://graph.microsoft.com/v1.0/users/{id}/joinedTeams . Please see the below image.
Try these steps and let me know if the issue still persists.
- Mamatha-MSFTApr 28, 2021Former Employeehidayat3676 Please let us know if the issue has been resolved.