Sales invoice pdf generation via API fails


Attempts to download sales invoice pdf via API (using Python requests library) from cloud edition fails, even though I’m able to list all available invoices and get the details for each of these invoices via API GET requests. For more insights into the error, I replicated the request using Postman.

The target URL is as thus: https://[domain][guid]&FileID=[code]. Find below the error response:

However, by making the same GET request via the browser I’m able to download the PDF.
Screen Shot 2020-12-08 at 7.26.16 AM

I’d really appreciate getting any pointers on resolving this issue.

Hi and welcome to the Forum.

The API topic is not particularly popular, but I will let you know that I can get the query to work with CURL (so your python should work) but I also found Postman would not work. so for example the following works: Tested with v10.20.89

curl -v -4 -G "https://administrator:@dev.mioapi.local/sales-invoice-view.pdf?Key=8c225451-45ac-418f-8253-245663c511dc&FileID=Tm9ydGh3aW5kLWRhdGE" -o "Invoice-1223-v20-10-89z.pdf"

where dev.mioapi.local points to a local nginX install with reverse proxy directly to the Server running on localhost:8123.

Hi @MarkLL,
Thanks for the help. Upon your feedback, I’ve tried using CURL with the same flags as your sample above (and some others afterwards) without any luck. The same error as before was encountered.

Here is a pertinent detail that might help to troubleshoot the issue: I connect via to a VPN with location set to the US but I'm located elsewhere; this was necessary as my requests got redirected to https://[domain] (even when using the browser). But even after properly handling the redirect when I connect without the VPN I encounter the same error as with the VPN as shown in the included screenshot.

The whole thing is quite confusing really as the same GET request succeeds on the browser (with a logged in session to

I wonder if @lubos can find the time to help with this. It will really be appreciated.

Thanks once more @MarkLL.

That indicates your Manager cloud account is not on your closest Manager cloud server. See

Don’t use a vpn for this as this is not a long term practical solution and is more likely to cause problems than solve it.

You need to change your location using the link posted in the above post if your server is not connecting to the correct area.

Mark should be able to help you with the programming side as he helped me with my issue. Unfortunately only a couple of people have the necessary knowledge to help you.

Thank you @lubos and @dalacor for the tip, I’d sure look into it.

Just an FYI… I did manage to get postman working but I had to use the full url e.g. for it work work correctly when fails.