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??
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…
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.
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…
@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.