We are aware of the issue with the badge emails resending to everyone, we apologise for the inconvenience - learn more here.
Forum Discussion
bspindia
2 years agoHelpful | Level 7
legacy token
my token is expiring while making api calls and getting unauthorised error due to short live tokens, how to generate unexpired token
please assist
regards,
Sikandar
- 2 years agoHurray made it$ch = curl_init();curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);curl_setopt($ch, CURLOPT_POST, 1);curl_setopt($ch, CURLOPT_POSTFIELDS, "grant_type=refresh_token&refresh_token=***refreshtoken******");curl_setopt($ch, CURLOPT_USERPWD, '**AppKey' . ':' . '***AppSecret*****');$headers = array();$headers[] = 'Content-Type: application/x-www-form-urlencoded';curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);$result = curl_exec($ch);echo $result;if (curl_errno($ch)) {echo 'Error:' . curl_error($ch);}curl_close($ch);
bspindia
Helpful | Level 7
every thing is fine when run from terminal, but can you please correct paramenters, i am getting this error
{"error": "invalid_request", "error_description": "The request parameters do not match any of the supported authorization flows. Please refer to the API documentation for the correct parameters."}
$headers[]="Accept:application/json";$headers[]="Content-Type:application/json";
$cl = curl_init();
curl_setopt($cl, CURLOPT_POST,true);
curl_setopt($cl,CURLOPT_HTTPHEADER,$headers);
curl_setopt($cl,CURLOPT_POSTFIELDS,'{"grant_type":"refresh_token"}');
curl_setopt($cl,CURLOPT_POSTFIELDS,'{"refresh_token":"****refresh_token_generated_from terminl******"}');
curl_setopt($cl,CURLOPT_POSTFIELDS,'{"****my_AppKey******":"***AppSecret*******"}');
curl_setopt($cl,CURLOPT_CONNECTTIMEOUT,2);
curl_setopt($cl,CURLOPT_RETURNTRANSFER,true);
$clRes = curl_exec($cl);
echo $clRes;
curl_close($cl);
Здравко
2 years agoLegendary | Level 20
bspindia wrote:...curl_setopt($cl,CURLOPT_POSTFIELDS,'{"****my_AppKey******":"***AppSecret*******"}');...
What's this? 🤔 Why it's here? Authentication passes through BASIC authentication or passed as a independent parameter(s) (what's this post parameter that you are posting above actually 🧐). Can you point exact parameter matching in the description?
- bspindia2 years agoHelpful | Level 7Hurray made it$ch = curl_init();curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);curl_setopt($ch, CURLOPT_POST, 1);curl_setopt($ch, CURLOPT_POSTFIELDS, "grant_type=refresh_token&refresh_token=***refreshtoken******");curl_setopt($ch, CURLOPT_USERPWD, '**AppKey' . ':' . '***AppSecret*****');$headers = array();$headers[] = 'Content-Type: application/x-www-form-urlencoded';curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);$result = curl_exec($ch);echo $result;if (curl_errno($ch)) {echo 'Error:' . curl_error($ch);}curl_close($ch);
About Discuss Dropbox Developer & API
Make connections with other developers
795 PostsLatest Activity: 4 days agoIf 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 or Facebook.
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!