Microsoft Graph
21 TopicsResource not found while trying to access the available resource
I am attempting to automate CRUD operations on Microsoft Entra objects using the Microsoft Graph API. However, I am encountering a Resource not found error when accessing a resource programmatically, even though the same resource is accessible without issue when invoking the API endpoint via Postman.10Views0likes1CommentMissing types in personType resource type documentation
Hi, Some time ago, I was working with the Microsoft Graph People endpoint and wanted to filter by personType properties. I’d like to suggest listing all possible values for personType in the documentation for the resource type. Here’s the documentation I’ve been using: personType resource type - Microsoft Graph v1.0 | Microsoft Learn After some research, I found this blog post that seems to contain relevant information: https://devblogs.microsoft.com/microsoft365dev/people-api-available-in-microsoft-graph-v1/ Is this list still valid? If so, perhaps it could be included directly in the resource type documentation. ThanksSolved74Views0likes2CommentsDifficulty 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?218Views0likes2CommentsDownloading 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.289Views0likes0CommentsLogin 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, Jonathan749Views0likes1CommentSharepoint 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!!347Views0likes0CommentsMicrosoft 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.475Views0likes0CommentsUnable 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-MgGraph256Views0likes0CommentsPossible 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.272Views0likes0CommentsError 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!844Views0likes1Comment