-2

Can you please tell me, after executing this also I am not getting proper response.

MY script

$cmd="curl https://api.box.com/oauth2/token \ -d 'grant_type=refresh_token&refresh_token=uuuuuuuuu&client_id=uuuuuuu&client_secret=uuuuuuu' \ -X POST"; exec($cmd,$result);

response

Array ( [0] => {"error":"invalid_request","error_description":"Invalid grant_type parameter or parameter missing"} )
Touheed Khan
  • 2,149
  • 16
  • 26
Ganga U
  • 61
  • 7

1 Answers1

0

According to this answer the box.net documentation lacks of the information that the Content-Type of requests for OAuth needs to be application/x-www-form-urlencoded.

So try to add an -H "Content-Type:application/x-www-form-urlencoded" at the end of your cURL request.

The cURL documentation states that the parameter -d already sets Content-Type: application/x-www-form-urlencoded. But just according to other answers I found on Stack Overflow (here, here, and here) trying to set the Content-Type manually could specifically help with the box.net OAuth API.

LoHer
  • 172
  • 1
  • 13