KoenZomers / OneDriveAPI

API in .NET Framework 4.8.0, .NET Core 3.1 and .NET 6.0 to communicate with OneDrive Personal and OneDrive for Business
Eclipse Public License 1.0
109 stars 34 forks source link

[BUG] CreateFolder not working #43

Open frank4040 opened 4 months ago

frank4040 commented 4 months ago

Hi Koen,

Love your work! This is the first API I came across that actually works on private Onedrives. The only thing that does not seem to be working is creating a folder. When calling GetFolderOrCreate on a non existing folder, it always returns null and no folder is created (same when directly calling CreateFolder or CreateFolderInternal). This is BTW also the case in the included demo app. Am I doing something wrong here? Or was there a change in the Graph API that causes this?

says:

POST https://graph.microsoft.com/v1.0/me/drive/root/children
Content-Type: application/json
{
  "name": "New Folder",
  "folder": { },
  "@microsoft.graph.conflictBehavior": "rename"
}

The last parameter seems to be missing, but I guess there should be some default behavior and not make the call break. Even tried adding the parameter myself, but still the same result (could also be me doing it wrong)

Running on Windows 11, Visual Studio 2022, .NET Framework 4.8.

I'm puzzled, can't seem to make this work. Please help!