Thank you for visiting our Partner Zone. This area is an exclusive space for MYOB Partners. Find out how to Partner with MYOB.
June 2021
June 2021
Hi I have had the below working for several months but about a week ago this stopped working. Did the API receive an update?
{ "Errors": [ { "Name": "InternalError", "Message": "An exception was thrown that was not handled correctly. If this situation persists please contact developers@myob.com for further assistance.", "AdditionalDetails": null, "ErrorCode": 20, "Severity": "Error", "LearnMore": null } ], "Information": "Warning, error messages have not been finalised in this release and may change" }
<?php $curl = curl_init(); curl_setopt_array($curl, array( CURLOPT_URL => 'https://ar2.api.myob.com/accountright/cf....fd/Purchase/Bill/Service/bf7....68/Attachment', CURLOPT_RETURNTRANSFER => true, CURLOPT_ENCODING => '', CURLOPT_MAXREDIRS => 10, CURLOPT_TIMEOUT => 0, CURLOPT_FOLLOWLOCATION => true, CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1, CURLOPT_CUSTOMREQUEST => 'POST', CURLOPT_POSTFIELDS =>'{ "Attachment": { "OriginalFileName": "me.pdf", "FileBase64Content": "JVBER.....==" } }', CURLOPT_HTTPHEADER => array( 'x-myobapi-key: secretkey', 'x-myobapi-version: v2', 'Accept-Encoding: gzip,deflate', 'Content-Type: application/json', 'Authorization: Bearer AAE.......uw' ), )); $response = curl_exec($curl); curl_close($curl); echo $response;
June 2021 - last edited June 2021
June 2021 - last edited June 2021
Hi @Viital,
Thank you for reaching out, Please ensure that you are POSTing the correct body request with all of the required fields. You can view our support note HERE which has examples of the mandatory fields for the Bills Attachment endpoint.
Thanks,
@Hannah_B
MYOB API Specialist
MYOB API Support Centre|MYOB App Marketplace|MYOB AccountRight API Endpoint Doc's
Did my answer help?
Mark it as a Solution
June 2021
June 2021
Hi Hannah,
I have tried both ways as provided in your link below. Both return the same error.
The first example is what I have been using previously and this has been working fine.
Attachment | Array |
OriginalFileName | String |
FileBase64Content | String |
and
{ "Attachments": [ { "OriginalFileName": "Reece.pdf", "FileBase64Content": "J..KJH" } ] }
0
|
80
|
|||
by
Joleda
December
7
776
|
7
|
776
|
||
18
|
2167
|
|||
3
|
1274
|
|||
6
|
919
|