I want to get temporary link for the uploaded file but struggling with Content type header. I have tried several combinations of Content-Type
header but getting error with all. Also how can I use the function dbx.filesGetTemporaryLinks
instead of this code. Please let mw know.
Here is my code:
var urltemp = "https://api.dropboxapi.com/2/files/get_temporary_link "; jQuery.ajax({ "url": urltemp, "method": "POST",
"data": {
"path": "filepath"
},
"headers": {
"authorization": authorization,
'Content-Type': 'application/json; charset=utf-8'
//"Content-Type" :'text/plain; charset=dropbox-cors-hack'
},
body: JSON.stringify(null),
success: function(data) {
alert("success");
},
error: function(response) {
alert("error " + JSON.stringify(response));
}