msgraph
8 TopicsPossible bug with getting Special Folder query
Hello, Based on the documentationI 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.243Views0likes0CommentsGraph API deleted user attributes and searching / filtering
Is there a way to search deleted users by attributes with the Graph API? If so, which attributes are searchable? If I need to restore an account that I don't have the id / objectid for, I have to retrieve all deleted users and then filter the results. Also, is there a way to retrieve the onPremisesImmutableID and the lastDirSyncTime of a deleted user that was federated with AzureADConnect?464Views0likes0CommentsIssues with POST to GraphAPI with Powershell
I can export Intune policies using the API so i know i'm authenticated but when I try to POST one of the policies i get a response but its just a repeat of the JSON file and no Error or 201 success message. Invoke-RestMethod -Uri https://graph.microsoft.com/Beta/deviceManagement/deviceCompliancePolicies -Headers $global:authToken -Method POST -Body $json_output -ContentType "application/json" If i take the JSON file and paste it in to the body of MSGraph Explorer it works but i'm not sure why i'm not getting a response back.328Views0likes0CommentsCalling principal does not have required MSGraph permissions AuditLog.Read.All
I have a Runbook (Automation Accounts) parsing AAD SignIn and Audit logs, however, when it executesGet-AzureADAuditSignInLogs I'm getting the following error: Get-AzureADAuditSignInLogs : Error occurred while executing GetAuditSignInLogs Code: Authentication_MSGraphPermissionMissing Message: Calling principal does not have required MSGraph permissions AuditLog.Read.All The Managed Identity I'm using in Runbook has Security Reader role, but it doesn't seem to be enough?Solved16KViews0likes6CommentsAPI doc for msgraph deviceGeoLocation and hardwareInformation does not mention url path
I am trying to integrate intune api with my application. The API doc for msgraph deviceGeoLocation(https://learn.microsoft.com/en-us/graph/api/resources/intune-devices-devicegeolocation?view=graph-rest-1.0) and hardwareInformation (https://learn.microsoft.com/en-us/graph/api/resources/intune-devices-hardwareinformation?view=graph-rest-beta) does not mention url path for the resource. I have tried a few url paths as a gues but I got 400 /deviceManagement/managedDevices/{id} and I got data /deviceManagement/managedDevices/{id}/deviceGeoLocation -> 400 Unsupported (both 1.0 and beta) /deviceManagement/managedDevices/{id}/hardwareInformation -> 400 Unsupported (beta) Please suggest what url paths must I use to get these resources521Views0likes0CommentsHow to set default Profile Picture Instead of FirstName & LastName Initials?
When I am trying to REMOVE user image from MS Teams, it is replacing the user image with theFirstName & LastName Initials image andI am getting the same image from MS Graph endpoint. Question: 1. Is there any way to set default user placeholder image instead ofInitials? 2. Is there any MS Teams administrator setting that can not set the initials as a default user profile image.4.8KViews0likes3Commentsuploading local files from file share to SharePoint Online using MSGraph
Hi There, I am desperately searching for any blog or any article that explains the steps about how to upload local file share documents to SharePoint Online using MSGraph through a c# console application. Thank you so much for your help.. As of now i am using this code below to upload files using a PUT call. the code executes fine without error but when i open the file in SharePoint Online i get error stating "Sorry, this document cant be opened for editing". can anyone help me here please? public async Task CallWebApiAndProcessResultASyncFileUpload(string webApiUrlFileUpload ,string accessTokenFileUpload) { using (HttpClient client = new HttpClient()) { //String requestURI = webApiUrlFileUpload; //HttpContent httpContent = new StringContent("This Message is posted from Visual Studio Lab", Encoding.UTF8, "text/plain"); //HttpRequestMessage newPostRequest = new HttpRequestMessage(HttpMethod.Put, requestURI); //newPostRequest.Content = httpContent; //newPostRequest.Headers.Authorization = new AuthenticationHeaderValue("Bearer", accessTokenFileUpload); //var newResponse = await client.SendAsync(newPostRequest); //var theResponseString = await newResponse.Content.ReadAsStringAsync(); String requestURI = webApiUrlFileUpload; var path = @"C:\Users\Name\Desktop\TestDoc.docx"; var multiForm = new MultipartFormDataContent(); FileStream fs = File.OpenRead(path); multiForm.Add(new StreamContent(fs), "file", Path.GetFileName(path)); HttpRequestMessage newPostRequest = new HttpRequestMessage(HttpMethod.Put, requestURI); newPostRequest.Content = multiForm; newPostRequest.Headers.Authorization = new AuthenticationHeaderValue("Bearer", accessTokenFileUpload); var newResponse = await client.SendAsync(newPostRequest); var theResponseString = await newResponse.Content.ReadAsStringAsync(); } }1.1KViews0likes1CommentHow to create an <img> tag containing MSGraph photo/$value response BLOB
I'm creating a Sharepoint Application (using Shrepoint Framework) and I'm not being able to retrieve the Pohto BLOB returned when calling MSGraph "/me/photo/$value" api. I don't know how to convert the BLOB into a Base64 string. I know that the responseraw.body is a readable stream, but don't know hot to access it and use as a SRC of a IMG tag. I have made many attempts, I'm writing one to explain what I'm trying to accomplish: this.context.msGraphClientFactory .getClient() .then((client: MSGraphClient): void => { client.api('/me/photo/$value') .get((error, response: any, rawResponse?: any) => { const blobUrl = window.URL.createObjectURL(rawResponse.body); document.getElementById("myPhoto").setAttribute("src", blobUrl); }); }); This code fails because creteObjectURL has been deprecated. The MSGraph call works, but I can't process the response. Any suggestions?1.2KViews0likes1Comment