How to get a document pdf?
The cloud products' API allows you to obtain the PDF associated with the various types of documents in the system, whether Purchase Invoices, Sales Invoices, Credit Notes, Journal Entries or Receipts. Two ways to obtain the PDF are available, either by entering the record identifier or the natural key. To print a document To Reprint a document To generate a PDF in a language other than the original one, you must specify this in the request header. For example, to reprint in Portuguese a document originally printed in English, use Accept-Language –> pt-PT. The printing templates allow to define the document layout, so when they are not indicated in the request the default template associated to the entity is always used. To specify the template, you must add the parameter as indicated: The following is a list of some available templates for guides, orders and journal entries:https://baseurl/api/{{tenant}}/{{organization}}/billing/invoices/{{companyKey}}/{documentType}/{serie}/{seriesNumber}/print
https://baseurl/api/{{tenant}}/{{organization}}/billing/invoices/{{companyKey}}/{documentType}/{serie}/{seriesNumber}/printOriginal
using (HttpClient client = new HttpClient())
{
try
{
Console.WriteLine("Requesting the access token from the authorization server...");
client.BaseAddress = new Uri(RoseConstants.appBaseUrl);
client.DefaultRequestHeaders.Add("Accept-Language", "pt-PT");
(...)
}
catch (Exception ex)
{
throw new Exception(string.Format("Error getting token. {0}", ex.Message));
}
}
Templates
//?template
https://baseural/api/{{tenant}}/{{organization}}/billing/invoices/{{companyKey}}/{documentType}/{serie}/{seriesNumber}/print?template={ReportModelDefinitions}
login para deixar a sua opinião.