Hi I am new to Microsoft graph and I set up a Http call to Microsoft Graph that was working previously with the endpoint:
"https://graph.microsoft.com/v1.0/drives/{driveId}/root:{relative-path-to-root}:/children"
This was previously returning the one file in the folder but I am now getting a Item Not Found error.
This is the Code I have setup for this:
`client.DefaultRequestHeaders.TryAddWithoutValidation("Authorization", "Bearer " + accessToken);
var send = client.GetAsync(siteEndPoint).GetAwaiter().GetResult();
var sendContent = send.Content.ReadAsStringAsync().GetAwaiter().GetResult();
var site = JsonConvert.DeserializeObject<Site>(sendContent);
var driveEndpoint = $"https://graph.microsoft.com/v1.0/sites/{site.id}/drive";
var driveSend = client.GetAsync(driveEndpoint).GetAwaiter().GetResult();
var driveSendContent = driveSend.Content.ReadAsStringAsync().GetAwaiter().GetResult();
var drive = JsonConvert.DeserializeObject<Drive>(driveSendContent);
var driveId = drive.id;
var folderName = customerId.ToString() + "-" + name;
var itemEndpoint = $"https://graph.microsoft.com/v1.0/drives/{driveId}/root:/Folder1/{folderName}/Folder2:/children";
var itemSend = client.GetAsync(itemEndpoint).GetAwaiter().GetResult();
var itemSendContent = itemSend.Content.ReadAsStringAsync().GetAwaiter().GetResult();
var itemList = JsonConvert.DeserializeObject<Items>(itemSendContent);`
I am getting values for the site and the drive it is only the items that are causing an issue. Am I using the wrong endpoint here?
I have made the request as simple as possible by removing all the filters.
I have tried https://graph.microsoft.com/v1.0/drives/{driveId}/items/root/children as a test and this returns items without an issue.
I was expecting to see the files in Folder2