Hi,
I'm developing an integration between Powerbuilder PB 2019R3 application and a Financial API (external of my company) using HTTPClient, but I'm receiving the return error code 403 Forbidden.
// Code
string json, base64, url_api
Integer li_SendReturn
long lr_code
json = '{"grant_type":"client_credentials", "role":"software_house"}'
base64 = 'dXN1YXJpb3Rlc3RlOnNlbmhhdGVzdGU'
url_api = 'https://pix.tecnospeed.com.br/oauth2/token/'
HttpClient http
http = Create HttpClient
// Headers
http.SetRequestHeader("Content-Type", "application/json" )
http.SetRequestHeader("Authorization", "Basic " + base64)
http.SetRequestHeader("cache-control", "no-cache")
li_SendReturn = http.sendrequest('POST', url_api, json)
If http.GetResponseStatusCode() <> 200 Then
MessageBox('','Error: '+string(http.GetResponseStatusCode())+' - '+http.GetResponseStatusText())
end if
/// End
I've tested consuming the API via POSTMAN and it works fine.
Any idea where is my mistake?
Thanks in advanced.
Marcos