I need help to download PDF from a link from API

Yes i dont understand it as well. Because it must need something otherways anyone can get this invoice.
So I get the file from the api to download the support says.
Here is the link to the api docs. Hope you can help me.
https://restdocs.e-conomic.com/
Or tell me what you need??

1 Like

The documentation does not show any download option in the draft invoices schema.

Also, going back to the URL you provided in the screen it only has folders but no file name.

Can you check again?

@muneer
Thanks for your answer.
Not sure on what to check. But insn´t this docs


This is an extension of this topic.

I’ve tried a bunch of times to help and we just haven’t gotten very far.

I did create a demo project that works to Get the pdf url from the API and display it in a PDF Reader:

In case that’s helpful for @muneer or anyone else who has an idea about this.

1 Like

@tatiang
Can you guide me where to get the url for the pdf file? It will save me a lot of time finding it.

thanks @tatiang
I am very frustrated over this. it is almost the last thing i need in the app to finish…

send you a pm

1 Like

Thank you @funhall , I need the url in the JSON response. Where is it?

Sorry but not sure what you mean.
This i send in the request to the api https://restapi.e-conomic.com/invoices/drafts/16
And the I get the respons url from the api. that is in the text field.

1 Like

Where is the response url that has the pdf filename?

That is what I’m asking for.

This is a little imbarrising. Because I dont understand what you mean.
I send the request “https://restapi.e-conomic.com/invoices/drafts/16” to the API
and I get a lot in the response. Inside the response I take out the URL.
Is that what you ask for. So sorry bare over with me please…

image

1 Like

I read more in the docs and I think the pdf file is saved as a Base64 encoded which means you need two external libraries to solve the issue. One to decide the Base64 stream into the normal file string and then you need another external library to save the stream as a file.

This is my thoughts.

The support is writting as follow in danish. I translate below…
Det er en PDF fil du modtager, men du modtager ikke selve filen men alle data som skaber denne PDF.
Så når du laver et kald til /pdf så modtager du alle data som skal bruges for at kunne generere en PDF.
Det er ikke encoded i Base64 eller lign. Det er den fulde data streng som er PDF filen.
Best regards / Med venlig hilsen
Thomas Gutfelt Andreasen
API Support
Visma e-conomic
Keep up with us on twitter: @economicAPI

It is a PDF file you recieve. But you dont recieve the file itself but all the data that create this pdf. So when you make a call to/pdf you recieve all data to use for generating the pdf.
It is not encoded in Base64or something like it. It is the full data string for the PDF file.
So @muneer hope you are getting something out of this…

1 Like

@muneer I was able to display the “demo” pdf file in the PDF Reader component without doing any conversion. Just straight from the “download” property into that component. But I couldn’t get it to work with @funhall’s authentication and specific API URLs.

1 Like

i found aut there there was 2 empty spaces in the start of the URL in the project. Please try and check that @tatiang

1 Like

This is the reply that comes from the API response text


Are anyon reconciling this?? And know how to make a PDF out of it.

1 Like

If I test the most recent project link you send me in a private message in Thunkable Live on my iPhone and display the green error block, it gives me a message about “Unauthorized access… status code 401” when I tap the “API test” button. So you need to fix the authentication somehow.

The only way I know how to do that is to include all of the authentication details with theWeb API URL and then test that full url in a browser (not in Thunkable).

@tatiang Will it be possible to talk with you over skype msg or something.???
I think maybe that is easier for me. I realy like to get this working.
And maybe I could share my screen with you???

1 Like

No, sorry. I used to offer paid consulting but I’m no longer doing that.

If you can figure out the full url, I can help. But without that, I don’t have any idea how to proceed.

1 Like

The screen shown is a PDF file type.