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

Get data from Microsoft teams (shifts)

How to connect power bi to microsoft teams, extracting information from app shifts that its use from create timetable.

7 REPLIES 7
Highlighted
Community Support
Community Support

Re: Get data from Microsoft teams (shifts)

Hi @jmoreyproadata ,

Currently, we can't get data from Teams directly in Power BI.  We only can check usage data from Teams and view report in Teams . To make Power BI better, you can submit your request at Power BI Ideas and vote it up.

 

Best Regards,

Xue Ding

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Best Regards,
Xue Ding
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Highlighted
Community Support
Community Support

Re: Get data from Microsoft teams (shifts)

Hi @jmoreyproadata ,

Does that make sense? If so, kindly mark my answer as the solution to close the case please. More people will benefit from here. Thanks in advance.

 

Best Regards,

Xue Ding

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly. Kudos are nice too.

Best Regards,
Xue Ding
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Highlighted
Frequent Visitor

GRAPH API SHIFTS DATA FROM TEAMS TO POWERBI

Is it possible to use the Graph API to import the shift data from TEAMS to Power BI to use as a data slicer/ filter?? This is a very typical application for manufacturing. Much needed. Is it possible? Is that the BETA of Graph has this functionality. Is there a better way

 

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

Highlighted
New Member

Re: GRAPH API SHIFTS DATA FROM TEAMS TO POWERBI

The instruction specifies the {teamId} parameter, where can I get it?
Highlighted
Frequent Visitor

Re: GRAPH API SHIFTS DATA FROM TEAMS TO POWERBI

MOOREJEFF_0-1593095055661.png

C

Highlighted
Frequent Visitor

Re: GRAPH API SHIFTS DATA FROM TEAMS TO POWERBI

Update to my own question for other users. This does work. Use an "ODATA" connection to the Graph API ( beta ). Only the beta API has the shifts data. You can then expand the lists that are returned from the API. We are actually using the shifts time data to cross filter other data in PowerBi via a calculated column in DAX. 

Highlighted
New Member

Re: GRAPH API SHIFTS DATA FROM TEAMS TO POWERBI

$clientId = "XXXXXXXXXXXXXXXXXXXX"
$clientSecret = "XXXXXXXXXXXXXXXXXXXX"
$tenantName = "XXXXXXXXXXXXXXXXXXXX"
$resource = "https://graph.microsoft.com/"

$tokenBody = @{
Grant_Type = "client_credentials"
Scope = "https://graph.microsoft.com/.default"
Client_Id = $clientId
Client_Secret = $clientSecret
}
$tokenResponse = Invoke-RestMethod -Uri "https://login.microsoftonline.com/$TenantName/oauth2/v2.0/token" -Method POST -Body $tokenBody
#__________________________________#__________________________________#__________________________________#_______________________________

$URL = "https://graph.microsoft.com/beta/teams/XXXXXXXXXXXXXXXXXXXX/schedule"
$result = Invoke-RestMethod -Headers @{Authorization = "Bearer $($tokenResponse.access_token)"} -Uri $URL -Method Get -ContentType "application/json"

 

I use PowerShell

I have a mistake

 

Invoke-RestMethod : {
"error": {
"code": "Forbidden",
"message": "{\"error\":{\"code\":\"Forbidden\",\"message\":\"MS-APP-ACTS-AS header needs to be set for application context requests.\",\"details\":[],\"innererror\":{\"code\":\"MissingUserIdHeaderInAppContext\"}}}",
"innerError": {
"date": "2020-06-28T17:07:59",

 

How can I fix this error?

MS-APP-ACTS-AS

Helpful resources

Announcements
Community Blog

Community Blog

Visit our Community Blog for articles, guides, and information created by fellow community members.

Using the Community

Using the Community

Need help with the Power BI Community? Our 'Using the Community' support articles are a great place to start.

Community Summit North America

Community Summit North America

Innovate, Collaborate, Grow. The top training and networking event across the globe for Microsoft Business Applications

Power Platform 2020 release wave 2 plan

Power Platform 2020 release wave 2 plan

Features releasing from October 2020 through March 2021

Top Solution Authors
Top Kudoed Authors