Domain API: Specifying the language for a Document Printout (v.22)

Back in version 2019.1 this Domain API feature for getting a printout for a document (aka GetPrintout) was introduced.

https://support.erp.net/hc/en-us/articles/360016126414

In short, if you send such a request,

POST /api/domain/odata/Crm_Invoicing_Invoices(51a63a99-c96d-4876-b205-fced610143ae)/GetPrintout HTTP/1.1
Host: demodb.my.erp.net
Content-Type: application/json

{
    "fileFormat": "pdf",
    "printout": {
        "@odata.id": "General_Printouts(f5229037-b420-46a4-81a0-f11f7d112879)"
    }
}

You'll receive a printout of the corresponding invoice as a pdf file, base64 encoded.

In English.

But you don't always need a printout in English, do you?

It's now possible to specify the language of the printout. Here's how,

POST /api/domain/odata/Crm_Invoicing_Invoices(51a63a99-c96d-4876-b205-fced610143ae)/GetPrintout HTTP/1.1
Host: demodb.my.erp.net
Content-Type: application/json
Accept-Language: de { "fileFormat": "pdf", "printout": { "@odata.id": "General_Printouts(f5229037-b420-46a4-81a0-f11f7d112879)" } }

The only difference is the additional HTTP request header Accept-Language: de. This way, the result will be the same printout, but in German (of course if you have specified the corresponding translations in your multilanguage strings).

If you are not OK, adding a new HTTP header, you have two more options:

  • to specify a URL parameter culture=de
  • or set a cookie, containing the following key=value .AspNetCore.Culture=de

---

More information is available in our official documentation:

https://docs.erp.net/dev/domain-api/common-tasks/change-language.html

Have more questions? Submit a request

0 Comments

Please sign in to leave a comment.
Powered by Zendesk