Microsoft Graph
19 TopicsDifficulty with Auto-Answering VOIP Calls via Microsoft Graph API
Description: I'm working on a PowerShell script to initiate and auto-answer VOIP calls using the Microsoft Graph API. I have successfully set up my Azure App Registration, including a callback URI. However, I'm encountering issues when trying to auto-answer calls Details: Call Initiation: The script successfully initiates a call using the New-MgCommunicationCall endpoint. Call Status: The call transitions from "establishing" to "established" status as expected. Error on Auto-Answer: Upon attempting to auto-answer the call with the Invoke-RestMethod to the answer endpoint, I receive a 404 Not Found error. The output indicates that the call ID is valid, but it seems the call resource is not found at the time of answering. Current Script Setup: I'm using a callback URI (https://kyncomdigiwasusdev.onmicrosoft.com/callback) configured for handling call events. I have ensured the necessary permissions are granted in Azure for the app. I have tried various delays (currently set to 5 seconds) between establishing the call and answering it, but I still receive the 404 error. Questions: Are there any known issues with the auto-answer feature in the Microsoft Graph API for VOIP calls? What additional steps should I take to troubleshoot this error?190Views0likes2CommentsDownloading word file as PDF from SharePoint using graph api looses sensitivity-label
I have a word file in SharePoint Online document library, this file has Sensitivity label assigned to it. I am downloading this file using Graph SDK with query parameter 'format=pdf'. The file is successfully downloaded and saved as pdf, however, the sensitivity labels are lost. Graph url: https://graph.microsoft.com/v1.0/drives/b!blTHg...nEk/root:/test03/document.docx:/content?format=pdf I opened the same file in browser (Open in browser) and clicked on File --> Save as --> Download as PDF; this step retain the sensitivity labels. Why is the file when downloading from API loosing its labels? Note: I tried downloading directly using SharePoint URL and there too Label information is lost. The sensitivity labels does not carry any control mechanisms i.e., they are used for information classification.257Views0likes0CommentsLogin failed while configuring Azure SQL connector
Hello All, I'm trying to play with the Microsoft Graph connectors and trying to set up my first conector. I decided to use the Microsoft Azure SQL connector and went through the guides in Microsoft Learn https://learn.microsoft.com/en-us/microsoftsearch/mssql-connector https://learn.microsoft.com/en-us/microsoftsearch/configure-connector I created an Azure SQL Server and Database, registered the app and even put the app user as admin, I create an external user using the SQL CREATE USER [app name] FROM EXTERNAL PROVIDER and exec sp_addrolemember 'db_datareader', [app name]' Using SQL managment studio I'm able to connect to the SQL but when I try to configure the connector in the admin center I'm stuck on the Database settings screen, after selecting the "Test Connection" button I got the error message: "Error from database server: Login failed for user ''. Incorrect or invalid token." Thanks, Jonathan709Views0likes1CommentSharepoint Delta API 429 error due to unknow reasons
Hi All, We are getting 429 rate-limited responses from Graph API when fetching SharePoint via Delta APIs. The rate limited requests don’t resolve even after waiting for specified time and retrying for 3 times, so such requests fail causing data losses. If we are sending more requests than the allowed rate limit, we will get that reason in headers, but here no such reason is given which suggests that we don’t exceed rate limits and its some other unknown issue. As mentioned in the document highlighted in the this link; https://learn.microsoft.com/en-us/sharepoint/dev/general-development/how-to-avoid-getting-throttled-or-blocked-in-sharepoint-online#ratelimit-headers---preview there could be other reasons that could lead to rate limits. We make sure that we don't request the calls that exceed the count mentioned in RateLimit-Limit header. This makes it even harder to identify the exact cause. Any support related to this is appreciated!!317Views0likes0CommentsMicrosoft Graph API returns no data or unexpected errors for Viva Learning
Hello, I'm exploring options to create a custom learning management system for my company. The first thing I would like to do is to pull data from Microsoft Viva Learning via the Microsoft Graph API, for example to see which courses the employees have completed. The next step will be to write that data on a SharePoint site. I'm using the C# https://developer.microsoft.com/en-us/graph/quick-start example as a base, so I can make use of the Microsoft Graph SDK for C#. This is a .NET 7 project, so I upgraded it to a .NET 8 project with the latest versions of the packages: Azure.Identity version 1.11.2 Microsoft.Graph version 5.49.0 For authentication, I have 2 different clients in my code: ApplicationGraphClient which is using a ClientSecretCredential with a client secret provided by my administrator UserGraphClient which is using an InteractiveBrowserCredential, so that I can log in with my own account The following permissions have been given to the app by the administrator: application permissions User.Read.All LearningAssignedCourse.Read.All LearningContent.ReadWrite.All LearningSelfInitiatedCourse.Read.All Sites.ReadWrite.All delegated user permissions User.Read offline_access LearningAssignedCourse.Read LearningContent.ReadWrite.All LearningSelfInitiatedCourse.Read LearningProvider.ReadWrite Sites.ReadWrite.All According to the docs, it's possible to https://learn.microsoft.com/en-us/graph/api/learningcourseactivity-list?view=graph-rest-1.0&tabs=http#http-request both for the signed-in user, but also for any user by ID. However, in both cases, I'm getting an empty collection as a result, despite the facts that I've completed several courses in Viva Learning. There is no error or exception. in UserGraphClient: await graphClient.Me.EmployeeExperience.LearningCourseActivities.GetAsync(); // returns an empty collection in `ApplicationGraphClient: await graphClient.Users[myUser.Id].EmployeeExperience.LearningCourseActivities.GetAsync(); // returns an empty collection My administrator also made me a knowledge admin, so I have access to the admin tab of Viva Learning in Teams, and I'm able to export the course activity data for my user. The exported Excel file does contain the expected completed courses. I've also tried to get all the learning activities for all the employees, with a top 10 limit, but this fail with an unknown error and code 404, so I suppose it's implemented in the SDK but not supported by the API. In ApplicationGraphClient: await graphClient.EmployeeExperience.LearningCourseActivities.GetAsync(config => { config.QueryParameters.Top = 10; }); Lastly, I've tried to https://learn.microsoft.com/en-us/graph/api/employeeexperience-list-learningproviders?view=graph-rest-1.0&tabs=http#http-request using both the UserGraphClient and ApplicationGraphClient, and in both cases I get the error message "Insufficient privileges to complete the operation.". As you could see above, I do have the delegated LearningProvider.ReadWrite permission, so it should at least work for my signed-in user. Thank you in advance for your help.454Views0likes0CommentsUnable to delete Archived users from Viva Engage/yammer using powershell script
I want to delete Archived users who are there in VivaEnage/Yammer. I'm able to export the list but not able to delete users. Probably, some issues with this uri: $uri = "https://graph.microsoft.com/v1.0/yammer/users/$userId" Please suggest, what should I do. I have created this script, but getting this error in csv: Failed to remove: Response status code does not indicate success: BadRequest (Bad Request). Script: Set-ExecutionPolicy RemoteSigned $cred = Import-CliXml -Path 'C:\Script\Vaut\cred2.xml' $cert_graph = Get-ChildItem Cert:\LocalMachine\My\49054ea0593c0920e42b99fe99e9892833e651ec $appid_graph="MY_APPID_GRAPH" $tenantid="MY_TENANT_ID" $certid="MY_CERT_ID" $appid="MY_APP_ID" Connect-MgGraph -ClientID $appid_graph -TenantId $tenantid -Certificate $cert_graph # Fetch users whose display name contains "Archive" $users = Get-MgUser -Filter "startswith(displayName, 'Archive')" -All # Initialize a list to store operation results $results = @() # Loop through each user and remove from Viva Engage foreach ($user in $users) { $userId = $user.Id # Attempt to remove the user from Viva Engage (assuming correct API endpoint) try { # API endpoint might need modification based on exact requirements $uri = "https://graph.microsoft.com/v1.0/yammer/users/$userId" Invoke-MgGraphRequest -Method DELETE -Uri $uri $results += [PSCustomObject]@{ UserId = $userId UserPrincipalName = $user.UserPrincipalName Status = "Removed" } } catch { $errorDetails = $_.Exception.Message $results += [PSCustomObject]@{ UserId = $userId UserPrincipalName = $user.UserPrincipalName Status = "Failed to remove" ErrorDetails = $errorDetails # Add this line to record the error details } } } # Export results to CSV $results | Export-Csv -Path "C:\UserRemovalResults.csv" -NoTypeInformation # Disconnect the session Disconnect-MgGraph229Views0likes0CommentsPossible bug with getting Special Folder query
Hello, Based on the https://learn.microsoft.com/en-us/graph/api/drive-get-specialfolder?view=graph-rest-1.0&tabs=http I can perform the following query to get data about a certain Special folder in OneDrive. It works perfectly if I query myself: https://graph.microsoft.com/v1.0/me/drive/special/documents However, if I enter an actual "userId"https://graph.microsoft.com/v1.0/{userId}/drive/special/documents I'm getting data from a shared site, instead of my personal. {me}: https://contoso-my.sharepoint.com/personal/alex_growtek_contoso_com/Documents/Documents {userId}: https://contoso.sharepoint.com/Shared%20Documents/Documents Is it a bug? As I couldn't find the way to fix that.262Views0likes0CommentsError when doing query for drives on Sharepoint using Microsoft Graph in C#
I have this line of code Running on an app registration with these permissions In a basic .NET Core 7 app with added Microsoft.Graph client configured like this Sometimes this finds a drive for a given folderName successfully and other times, for the exact same folder name, it throws a general exception. It returns exception: General exception while processing at Microsoft.Kiota.Http.HttpClientLibrary.HttpClientRequestAdapter.ThrowIfFailedResponse(HttpResponseMessage response, Dictionary`2 errorMapping, Activity activityForAttributes, CancellationToken cancellationToken) at Microsoft.Kiota.Http.HttpClientLibrary.HttpClientRequestAdapter.SendAsync[ModelType](RequestInformation requestInfo, ParsableFactory`1 factory, Dictionary`2 errorMapping, CancellationToken cancellationToken) at Microsoft.Kiota.Http.HttpClientLibrary.HttpClientRequestAdapter.SendAsync[ModelType](RequestInformation requestInfo, ParsableFactory`1 factory, Dictionary`2 errorMapping, CancellationToken cancellationToken) at Microsoft.Graph.Drives.Item.SearchWithQ.SearchWithQRequestBuilder.GetAsSearchWithQGetResponseAsync(Action`1 requestConfiguration, CancellationToken cancellationToken) What am I missing? Thanks in advance!796Views0likes1CommentFolderContact
Good morning, I wanted to understand something. I have created an app on the Azure portal to run queries via powershell. https://graph.microsoft.com/v1.0/users/[email address]/contactFolders The problem I am experiencing is on the Microsoft Graph Explorer part, it seems that it does not have sufficient permissions to read a user's contact folders (I am not experiencing any kind of problem with mine) I report the error Forbidden - 403 - 404ms. Either the signed-in user does not have sufficient privileges, or you need to consent to one of the permissions on the Modify permissions tab The permits that are assigned are as follows: What am I doing wrong?468Views0likes1CommentWeird result when using MS Graph for Access Review Owners
Greetings, I am trying to create an Azure Access Review which includes both members and owners for the review process, where the group owners are also the reviewer in said Access Review. Since there are over 500+ groups in our tenant, I am using Microsoft Graph to automate this using a powershell script. When I use the members value in the request body, everything works out fine, but when I use owners in the request body, I get a weird result which I was able to replicate using the MS Graph Explorer. As an exercise, I used the MS Graph explorer for the following: Best Case Scenario POST (beta): https://graph.microsoft.com/beta/identityGovernance/accessReviews/definitions Request Body: { "displayName": "Group Members Access Review", "descriptionForAdmins": "Reviews access to all group members in the organization", "reviewType": "AccessReview", "scope": { "query": "/groups/{group id}/members", "queryType": "MicrosoftGraph" } } Result is: The access review is successfully created in Azure. You can see it in the GUI on the web. ===================== Bad Case Scenario POST (beta): https://graph.microsoft.com/beta/identityGovernance/accessReviews/definitions Request Body: { "displayName": "Group Owners Access Review", "descriptionForAdmins": "Group owners in the organization", "reviewType": "AccessReview", "scope": { "query": "/groups/{group id}/owners", "queryType": "MicrosoftGraph" } } The result is: { "error": { "code": "", "message": "PartnerData | Partner Record with Id 00000000-0000-0000-0000-000000000000 not found in repository", "innerError": { "date": "2023-08-18T16:17:48", "request-id": "{request id auto-generated}", "client-request-id": "{client-request-id auto-generated}" } } } I don’t have this PartnerData in my tenant, but I get the feeling this is something from within Graph API maybe. All I want to do is create an access review that includes both group members and owners. Any ideas?884Views0likes0Comments