- Daniel Ferrreira
- PowerBuilder
- Thursday, 14 January 2021 03:25 AM UTC
Hi guys,
Can you please help me out here?
I'm trying to do this call using PB 2019 R2:
curl https://www.tiendanube.com/apps/authorize/token \
--data \
'client_id=123&client_secret=abcdef&grant_type=authorization_code&code=xyz'
Below is an image of the Postman call that works, although the values are fake.
All the other tabs have default values, I've only filled the Body tab.
This is my sample code, that returns this error:
{"error":"invalid_request","error_description":"The grant type was not specified in the request"}
String ls_body, ls_id, ls_secret
RestClient lRestClient
lRestClient = Create RestClient
ls_id = '123'; ls_secret = 'abcdef'; as_code = 'xyz';
ls_body = 'client_id=' + ls_id + '&client_secret=' + ls_secret + '&grant_type=authorization_code&code=' + as_code
ll_ret = lRestClient.sendPostRequest(ls_url, ls_body, ls_jsonRet)
Thanks a lot!!
Find Questions by Tag
Helpful?
If a reply or comment is helpful for you, please don’t hesitate to click the Helpful button. This action is further confirmation of their invaluable contribution to the Appeon Community.