0
votes

I'm developing AirFile, which support multi clouds. Now, i'll support Office 365 & OneDrive Pro for Business. I has finished other operations as: get list of files, copy, move, upload, download, delete. But with Create a Folder, it cannot been finished!!

As Office 365 document APIS (http://msdn.microsoft.com/EN-US/library/office/dn605900(v=office.15).aspx#Folder4), i has set data when send a POST request with:

- (NSData *)postMehodData
{
    NSString *params = @"{'__metadata':{'type':'MS.FileServices.Folder'},Name:'%@'}";
    params = [NSString stringWithFormat:params, [self.folderName stringByAddingPercentEscapesUsingEncoding:NSUTF8StringEncoding]];
    return [params dataUsingEncoding:NSUTF8StringEncoding];
}

I has also set request' url as API references, but the result's always HTTP 400 code.

I also reference Android code from https://github.com/OfficeDev/Office-365-SDK-for-Android/blob/master/sdk/office365-files-sdk/src/com/microsoft/office365/files/FileClient.java, but i cannot see why it's wrong!

If i can missing any? Thanks any support.

2

2 Answers

1
votes

I'm also seeing issues with the Create Folder function of the Office365 API. I am developing in NodeJS (not using any of the provided libraries) and I am able to do most of the functions advertised by the API. I am able to create folders if I am a global administrator on the Office365 account, but not if I am typical user within the Office365 environment.

I don't see anything inside the Azure AD permissions specifically for "Create Folders", the closest item is "Edit or delete users' files" or "Create or delete items and lists in all site collections".

Both the administrator and user do result in HTTP 200, but the User gets an Access Denied error.

My guess is that "Create or delete items and lists in all site collections" is an admin function and since the "user" can't grant those privileges, the folders are not created. Although I would have expected "Edit or delete users' files" to be enough to create folders, since I can create and upload files to folders that are already created.

I am using the same structure for the __metadata as you are above.

Based on my observations there is something not quite right with Create Folder, whether it be permissions based or not fully baked.

I'm happy to share more if I can help to clarify my findings. Finding help online is quite impossible now, although Microsoft is supposed to be on these forms somewhere.

1
votes

The Office 365 APIs are still in preview. It looks like the problem you mentioned has already been resolved, but please be aware that until the APIs are officially released, things may still change. As such, do not use them in production yet.