Thank you for visiting our Partner Zone. This area is an exclusive space for MYOB Partners. Find out how to Partner with MYOB.
June 2019
June 2019
I am trying to use the RenderAsPdf api functionality to return a pdf of my requested invoice.
I am doing a get request to https://api.myob.com/au/essentials/businesses/683041/sale/invoices/374108193
The api instructions for RenderAsPdf say that all I need to do is pass an additional HEADER Accept: Application/PDF which I do as you can see from my list of headers below:
[
0 => "Authorization: Bearer [my access token]"
1 => "x-myobapi-key: [my key]"
2 => "x-myobapi-version: v0"
3 => "Accept: application/json"
4 => "x-myobapi-cftoken: Og=="
5 => "Accept: Application/PDF"
6 => "Accept-Encoding: gzip,deflate"
]
When I do this request I get the invoice as JSON, not as a PDF. Any ideas what could be going wrong?
Solved! Go to Solution.
June 2019
June 2019
Hi @ECCC , could it make a difference if you use "Accept: application/pdf" (note lower-case), following the style of the json header?
Regards, Mike (mike@datawise.co.nz)
DataWise Limited (www.datawise.co.nz), developers of:
DataWise ProActive - Custom Reporting from MYOB programs
(MYOB Business, including AccountRight Live, AccountRight v19.x and exo Payroll)
Bulk download of attachments (more details...)
June 2019
June 2019
Ok, I figured it out. I forgot to set the headers with curl. What a dunce!
It's working like a charm now.
by
jlyall
a month ago
8
383
|
8
|
383
|
||
7
|
396
|
|||
3
|
244
|
|||
5
|
320
|
|||
5
|
280
|