I am getting this error when attempting to access the API. The diagnostic on my script reproduces the exact JSON string that is passed to the API. When this is pasted into the sandbox, it works fine. I suspect there is something wrong with the way I am calling it.
I know I’m so close on this, any advice would be appreciated.
The operative lines of code are:
$guzzleClient = new GuzzleHttp\Client(["base_uri" => "https://api.quickfile.co.uk/1.2/"]);
.
.
try {
$result = $guzzleClient->post("invoice/search", ["json" => jsonRequest($submissionNumber, $AccountNum, $md5Key, $ApplicationID)]);
echo 'success';
}
etc
the function json request populates the template with the required parameters and returns a pure json string
{
"payload": {
"Header": {
"MessageType": "Request",
"SubmissionNumber": "as per parameter",
"Authentication": {
"AccNumber": "as per parameter",
"MD5Value": "as per parameter1",
"ApplicationID": "as per parameter"
}
},
"Body": {
"SearchParameters": {
"ReturnCount": "100",
"Offset": "0",
"OrderResultsBy": "InvoiceNumber",
"OrderDirection": "ASC",
"InvoiceType": "RECURRING",
"ShowDeleted": "false"
}
}
}
}