mthu9
mthu9

Reputation: 13

How to get online meeting attendance report ? / Microsoft Graph API

I'm trying to get attendance intervals for every user that joined the meeting. I'm using Python request lib.

When I call API with https://graph.microsoft.com/beta/users/{user_id}/onlineMeetings/{meeting_id}/attendanceReports

this error occurs:

"Application does not have permission to GetMeetingAttendanceReport online meeting on behalf of this user."

I successfully get results when I run the same query via Graph Explorer instead of Python request lib.

Added OnlineMeetings.ReadAll etc. permissions and granted admin consent doesn't help.

Upvotes: 0

Views: 1550

Answers (3)

mthu9
mthu9

Reputation: 13

Creating an application access policy solved the problem.

For those who encounter this situation, Connect Microsoft Teams via Windows Powershell ISE and follow the steps in the document

Upvotes: 1

Rexhi
Rexhi

Reputation: 251

Try '/meetingAttendanceReport' instead of '/attendanceReports' in the url.

Upvotes: 1

Tiny Wang
Tiny Wang

Reputation: 15991

According to your description, you successfully get results when using Graph Explorer, so it should be ok to get correct results through the same user and the same api permission. I'm afraid that you need to check the azure ad application api permission then.

Go to azure portal and find the azure ad application which you used in your python application. Go to the api permission blade to check if the delegate permission OnlineMeetingArtifact.Read.All mentioned in the api document has been added to the permission list.

And if you wanna use application permission in your python project, you should add application permission here.

enter image description here

Then you are supposed to generate a correct access token via this application, whatever using client credential flow to generate an application token or auth flow to generate a user token.

enter image description here enter image description here

And if you wanna test with http request first, you can set your request like my sample below to generate an application permission token then use it to call your api.

enter image description here

Upvotes: 0

Related Questions