graph
15 TopicsGraph CallRecords
Hi, I'm trying to find a way to get Teams Call Queue calls waiting time (how much time the caller waits on the queue before an agent took the call). By using the Get CallRecord method I was able to get details about regular Teams calls by call ID - GET https://graph.microsoft.com/v1.0/communications/callRecords/{id} I was wondering if I can do the same with Call Queue\Auto Attendant calls and try to figure out the waiting time with the data I will get. I know 3rd party tools, which gives the details I'm looking for, using Graph webhook subscription - so I'm pretty sure I can get this data too, just can't find out how. Any suggestions would be appreciated. Thanks.6KViews1like9CommentsProvisioning Shifts (schedule) for a Microsoft Team via PowerShell
Hi 🙂 I am trying to provision Shifts (schedule) for Teams. The overall script creates a new Team, then passes the ID to the shifts piece. But I cannot, for the life of me, find a way to provision it. Here's my code (using a hard coded ID till I figure out what's up.) Ultimately, this will be part of a script that creates several Teams, each needing to have Shifts enabled. Where I start # THIS IS WHERE I'M STUCK # in my code, trying to work with the "Enabled" parameter, I have tried to use $true, 1, nothing, "yes". Nothing works. If I don't leave the space null after -Enabled, I get an error "Update-MgTeamSchedule : A positional parameter cannot be found that accepts argument 'True'" (or whatever notnull value I put there.) If I leave the space after -Enabled null, I get "Update-MgTeamSchedule : [UnknownError] : At line:1 char:1 + Update-MgTeamSchedule -TeamId e532aa85-3ec5-4318-9515-6c60cfaa7f36 -E ... + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + CategoryInfo : InvalidOperation: ({ TeamId = e532...GraphSchedule }:<>f__AnonymousType0`2) [Update-MgTeamSchedule_UpdateExpanded], Exception + FullyQualifiedErrorId : UnknownError,Microsoft.Graph.PowerShell.Cmdlets.UpdateMgTeamSchedule_UpdateExpanded" AND - how should the TimeZone be formatted for New York? "American/NewYork" or "American/New York" (with or without a space). Any help would be greatly appreciated. 🙂 🙂 (I am not a PS pro obviously, but I am a super enthusiast.) TIA! function EnableShifts { param ( [parameter( HelpMessage = "Group ID" )] [string] $tGroupId ) process { #Import-Module -Name MicrosoftTeams Connect-MicrosoftTeams -Credential $cred # Let's make sure it's getting the ID Write-Host "Group ID:" $tGroupId <# company/app info #> $AppId = "xx" $AppSecret = 'xx' $TenantId = "xx" #$TenantName = "xx" #$TenantShortName = "xx" # Construct URI and body needed for authentication $uri = "https://login.microsoftonline.com/$TenantId/oauth2/v2.0/token" $body = @{ client_id = $AppId scope = "https://graph.microsoft.com/.default" client_secret = $AppSecret grant_type = "client_credentials" } # Get OAuth 2.0 Token $tokenRequest = Invoke-WebRequest -Method Post -Uri $uri -ContentType "application/x-www-form-urlencoded" -Body $body -UseBasicParsing # Unpack Access Token $token = ($tokenRequest.Content | ConvertFrom-Json).access_token $headers = @{Authorization = "Bearer $token" } $ctype = "application/json" # check out the Team output Get-Team -GroupId $tGroupId $uriPath = "https://graph.microsoft.com/v1.0/teams/$tGroupId" # Connect to graph to use the graph powershell modules Connect-Graph -Scopes Schedule.ReadWrite.All -TenantId $TenantId try { # see what this command returns Get-MgTeamSchedule -TeamId $tGroupId # THIS IS WHERE I'M STUCK # Update-MgTeamSchedule -TeamId $tGroupId -Enabled $true #Invoke-WebRequest -Method Put -Uri "$uriPath/schedule" -ContentType $ctype -Headers $headers # | ConvertTo-Json Write-Host "Shifts provisioned" } catch { Write-Host "Error provisioning Shifts:" $Error -BackgroundColor yellow -ForegroundColor black break } finally { } } } #for testing. comment out to use the CreateTeams_Search.CSV EnableShifts -tGroupId "xxx" #Team id5KViews0likes3CommentsTeams direct Routing - Why still not usable with Graph API?
Hi MS Team, at the moment at each customer we have the request of using MS Teams for calling via direct routing. But the pain with this is that we or the customer have to configure this each time with Powershell. And also they need to configure the PBX Site per User. If the direct routing configuration would be available via Graph API it would be so easy to create applications which configure both sites at the same time. And now this feature is there for almost 2 years, but still now usable via API. I dont know why this is still not possible. Does anybody have an informations when MS will implement this?4.7KViews1like9CommentsAdd a User to a Group/Team with Graph
I know this is basic but I've been trying for hours to get this to work. The example in the docs is wrong. I want to add a user to a group/team. Here's the code at issue: var group = new Group { AdditionalData = new Dictionary<string, object>() { {"@odata.id", "https://graph.microsoft.com/v1.0/users/{00000000-0000-0000-000000000000}"} } }; await graphClient.Groups["{00000000-0000-0000-0000-000000000000}"].Request().UpdateAsync(group); I feel like it's the odata part that I don't have right but I can't find an example that shows the correct format.3.2KViews0likes2CommentsUnable to delete team members via Graph
A couple of weeks ago the delete group member method stopped working: DELETE https://graph.microsoft.com/v1.0/groups/{id}/members/{id}/$ref The deleted user is still able the to connect to the group via Teams (webapp, clientapp) and send messages to channels, etc. Only the related SharePoint site gets unavailable for the user. Thank you, Zsolt3KViews0likes14CommentsValidating a user's membership of a Team - Context object
We should use the values from the https://docs.microsoft.com/en-us/javascript/api/@microsoft/teams-js/microsoftteams.context?view=msteams-client-js-latest with due care, as someone might be running our app in a rogue environment, injecting values to manipulate the outcome. For the user's login, I understand that we use it as a login hint and the authentication flow will always end in an interactive logon screen if that login hint is unknown. So we are pretty safe there. But what about the organisationId / teamId if you have created a Team tab. How can we check whether that user is actually part of that team, if we only have user-delegated access? If we want to consult the https://docs.microsoft.com/en-us/graph/api/user-list-joinedteams?view=graph-rest-1.0&tabs=http or https://docs.microsoft.com/en-us/graph/api/group-list?view=graph-rest-1.0&tabs=http endpoints of Microsoft Graph, we need admin-level consent (only permissions ending in ".All" can do this query). I really want to avoid needing admin consent (for obvious reasons).Solved1.8KViews0likes5CommentsMicrosoft Teams: webpage Authentication inside tab
Hi, I'm developing a webapp that's inside a tab in microsoft teams. The webapp uses the GRAPH API and SharePoint API to retrieve data from sharepoint and data from graph. I need to use both api's to utilise all the resources to the max. How can I authenticate inside the microsoft teams tab for BOTH graph and sharepoint? Do I need to do 2 authentications so I have 2 tokens? (1 for each endpoint) Or can I fetch 1 token that works for both api's?1.6KViews0likes2CommentsFailed to delete a channel via Graph
I have a few Power Automate flows for deleting channels via Graph (Beta). They worked well before till I found a lot of failures yesterday: { "error": { "code": "BadRequest", "message": "Failed to execute Skype backend request GetThreadS2SRequest.", "innerError": { "date": "2020-11-17T14:37:57", "request-id": "fec4ca54-b0e0-4b39-9329-8d85dfff67a8", "client-request-id": "fec4ca54-b0e0-4b39-9329-8d85dfff67a8" } } } Something wrong with the Graph API?1.2KViews0likes4CommentsWrong notification subtitle in 1-to-1 chats on Android
Summary Activity notification subtitles are incorrect in one-on-one chats on Android. Actual result This is an activity notification on Android. The subtitle shows "Chat with Worldr", Worldr is the application name. Expected result This is the same activity notification, but in Web. It shows the name of the one-on-one chat, as expected API Request The following Graph API request was used to create the examples, {chat_id} and {user_id} are replaced. The request used an application token. POST https://graph.microsoft.com/v1.0/chats/{chat_id}/sendActivityNotification { "topic": { "source": "entityUrl", "value": "https://graph.microsoft.com/v1.0/chats/{chat_id}" }, "activityType": "message", "previewText": { "content": "Hello, World" }, "recipient": { "@odata.type": "microsoft.graph.aadUserNotificationRecipient", "userId": "{user_id}" }, "templateParameters": [ { "name": "tabName", "value": "Example" } ] }1KViews0likes6Comments