Can anyone help me execute this curl command using httpjob.
The Dropbox API documentation refers to this curl command:
curl https://api.dropbox.com/oauth2/token \
-d grant_type=refresh_token \
-d refresh_token=<REFRESH_TOKEN> \
-d client_id=<APP_KEY> \
-d client_secret=<APP_SECRET>
I have found a few httpjob examples in the forum, but my difficulty is how to supply the necessary parameters in the correct order. I have tried this:
This keeps resulting in 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."}
I have tried the above code by including the "-d" before the first element of the data Map. Same result.
Your help is always appreciated.
The Dropbox API documentation refers to this curl command:
curl https://api.dropbox.com/oauth2/token \
-d grant_type=refresh_token \
-d refresh_token=<REFRESH_TOKEN> \
-d client_id=<APP_KEY> \
-d client_secret=<APP_SECRET>
I have found a few httpjob examples in the forum, but my difficulty is how to supply the necessary parameters in the correct order. I have tried this:
B4X:
Dim data As Map
data.Initialize
data.Put("grant_type", "refresh_token")
data.Put("refresh_token", "<REFRESH TOKEN>")
data.Put("client_id", "<APP_KEY>")
data.Put("client_secret", "<APP_SECRET>")
Dim j As HttpJob
j.Initialize("", Me)
j.PostString("https://api.dropbox.com/oauth2/token",data.As(JSON).ToString)
j.GetRequest.SetContentType("application/json")
Wait For (j) JobDone(j As HttpJob)
If j.Success Then
Log(j.GetString)
Else
Log(j.ErrorMessage)
End If
j.Release
This keeps resulting in 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."}
I have tried the above code by including the "-d" before the first element of the data Map. Same result.
Your help is always appreciated.