1
votes

I am getting this error:

{"error":{"code":"accessDenied","message":"Access Denied"}}

everytime i am using the onedrive api the scopes i use are:
wl.signin,wl.offline_access, onedrive.readonly, onedrive.readwrite, onedrive.appfolder

I am able to login, logout, edit and delete items and folders, retrieve the files for each and every folders but why can't I add a folder?

This is the api url I used to try to add the folder:
https://api.onedrive.com/v1.0/drive/items/{{THE PARENT ID}}/children?nameConflict=fail

I use curl post, body is json encoded:

$data = json_encode(array("name"=>"".$title,"folder"));

Please help me resolve my issue. :(

1
Also tried this to rename folder if it is already existing: api.onedrive.com/v1.0/drive/items{{THE PARENT ID}}/children?nameConflict=rename - charm

1 Answers

0
votes

I just have to create the data to be passed to url as a string and not as an array. That solved my problem. Thanks everyone.