Forum Discussion

umairali's avatar
umairali
New member | Level 2
8 years ago

Error in call to API function "auth/token/from_oauth1": Bad HTTP "Content-Type" header: "application

i am calling app auth api but i am receiving below error.

 

Error in call to API function "auth/token/from_oauth1": Bad HTTP "Content-Type" header: "application/json; boundary=------------------------796cea680fa095ca". Expecting one of "application/json", "application/json; charset=utf-8", "text/plain; charset=dropbox-cors-hack".

 

Code

$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, "https://api.dropboxapi.com/2/auth/token/from_oauth1");
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, 'POST');
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_HTTPHEADER, array(
'Content-Type: application/json',
'Authorization: Basic bmF0dWdweTsdwqegzbnE1MDFs4OnFiN3F3an3p3anpkdGJzOA=='
));
curl_setopt($ch, CURLOPT_POSTFIELDS, array(
'oauth1_token' => 'natugpy83123nq5sdf01l',
'oauth1_token_secret' => 'qb7qwjsdfzwjzdtfbs8',
));
$result = curl_exec($ch);
curl_close($ch);

1 Reply

About Dropbox API Support & Feedback

Node avatar for Dropbox API Support & Feedback
Find help with the Dropbox API from other developers.

The Dropbox Community team is active from Monday to Friday. We try to respond to you as soon as we can, usually within 2 hours.

If you need more help you can view your support options (expected response time for an email or ticket is 24 hours), or contact us on X, Facebook or Instagram.

For more info on available support options for your Dropbox plan, see this article.

If you found the answer to your question in this Community thread, please 'like' the post to say thanks and to let us know it was useful!