when I try to hit https://content.dropboxapi.com/2/files/upload and get id from that for uploaded data I need URL so hit https://api.dropboxapi.com/2/sharing/get_file_metadata but getting 400 erro please let me know what is issue.
try{
var setFilePublicBody = {
"file": "id:5LsYZF1Brd8AAAAAAAAAQQ",
"actions": []
};
var xhr1 = new XMLHttpRequest();
xhr1.open("POST", "https://api.dropboxapi.com/2/sharing/get_file_metadata", true);
xhr1.setRequestHeader("Authorization", "Bearer " + storageSettings.api_token);
xhr1.setRequestHeader("Content-type", "application/json");
xhr1.setRequestHeader("Dropbox-API-Arg", '{"path": "' + path + '" ,"mode":"add","autorename":true,"mute":false,"strict_conflict":false}');
xhr1.send(setFilePublicBody );
if (xhr1.readyState === 4) {
console.log('success');
}
}catch(err){
console.log('url request......eroor =>'+err);
}