Server error: 'POST https://api.reckon.com/RAH/v2' resulted in a '500 Internal Server Error' respons
Raymond Dacillo
Member Posts: 12 Novice Member
Hi,
Just want to ask why I always getting this error when I request to the api.
Here's my code when requesting to your api
HttpClient::request('POST', 'https://api.reckon.com/RAH/v2', [
'body' => '{"FileName":"Q:\\Cougar Enterprises.QBW","Operation":"<?xml version="1.0\""?><?qbxml version=\""6.1\""?><QBXML><QBXMLMsgsRq onError=\""continueOnError\""><SalesTaxCodeQueryRq /></QBXMLMsgsRq></QBXML>"",""UserName"":""Admin"",""Password"":""admin"",""CountryVersion"":""2019.R2.AU""}',
'headers' => [
'Authorization' => 'Bearer 4785b4ab2ea91351ba4202a04f9ba893myToken',
'Content-Type' => 'application/json'
]
]);![image]()
"
Just want to ask why I always getting this error when I request to the api.
Here's my code when requesting to your api
HttpClient::request('POST', 'https://api.reckon.com/RAH/v2', [
'body' => '{"FileName":"Q:\\Cougar Enterprises.QBW","Operation":"<?xml version="1.0\""?><?qbxml version=\""6.1\""?><QBXML><QBXMLMsgsRq onError=\""continueOnError\""><SalesTaxCodeQueryRq /></QBXMLMsgsRq></QBXML>"",""UserName"":""Admin"",""Password"":""admin"",""CountryVersion"":""2019.R2.AU""}',
'headers' => [
'Authorization' => 'Bearer 4785b4ab2ea91351ba4202a04f9ba893myToken',
'Content-Type' => 'application/json'
]
]);
"
0
Comments
-
Hi Raymond,
I'm not that familiar with guzzle, but maybe try using json_encode() on your body. Or if that doesn't work try using json instead of body http://docs.guzzlephp.org/en/stable/request-options.html#json.
I can show how I get it to work with curl if you want.
Regards,
Shane
Reckon API Team
0 -
Hi Shane,
You're right. I just need to use json instead of body. Thanks0
This discussion has been closed.