I want to create a folder as soon as the user login in the app,
i tried the following function to create folder but i can see no folder is created..
I am calling this function after the login..
CreateFolder()
{
let args={
"path": "/Homework/math",
"autorename": false
}
let headers = new Headers();
headers.append('Authorization','Bearer'+this.accessToken);
headers.append('Dropbox-API-Arg', JSON.stringify(args));
headers.append('Content-Type', 'application/json');
console.log("created folder");
return this.http.post('https://api.dropboxapi.com/2-beta-2/files/create_folder',{headers:headers});
}
}
dropboxlogin()
{
this.dropbox.login().then((success) => {
this.navCtrl.push(DropboxloginPage);
this.dropbox.CreateFolder();
this.showToast("folder created");
}, (err) => {
console.log(err);
});
}