Appearance
POST
/communication/template-text/template-texts/{id}/locales/{locale}/attachments/reportsRequired scope:
templatetext:updateAttaches a report to a language of an e-mail template. The report is generated as a PDF when the mail is sent. The url that Ramos reads (ramos://report/
Parameters ​
Path parameters
locale stringLocale code (e.g. 'sv', 'en').
Request body ​
JSON
{
"reportId": 10035,
"parameters": {
"inorderno": "{inorderno}",
"origin_invoice": ""
},
"fileName": "Purchase_order_{inorderno}.pdf",
"description": "Purchase order",
"languageId": 1,
"skuFormatId": 0
}
Response ​
The attachment that was added.
JSON
{
"id": "6f1c4c0e-2a53-4f5c-9d6a-0c3f6b1d7a11",
"kind": "REPORT",
"fileName": "Purchase_order_{inorderno}.pdf",
"description": "Purchase order",
"reportId": 10035,
"parameters": {
"inorderno": "{inorderno}"
},
"languageId": 1,
"skuFormatId": 0,
"size": 48213,
"contentType": "application/pdf"
}
| Error code | Description |
|---|---|
attachments-not-supported | The template is an SMS or an invoicetext; only an e-mail can have attachments. |
duplicate-attachment-name | The language already has an attachment with the file name, in any case. |
invalid-attachment-description | The description is blank or longer than 2000 characters. |
invalid-attachment-name | The file name is blank, longer than 255 characters, does not end with .pdf or has a character that a file name cannot have (/ : * ? " < > | or a control character). |
invalid-report-parameter | A parameter name or value is not allowed (names: letters, digits, dot, underscore, hyphen, and not report.report_id, report.language.id or report.skuFormat.id; values: empty, the same characters, or one {placeholder} of letters, digits and underscore), an id is negative, or the url would be longer than 512 characters. |
locale-not-found | The template does not have the locale. |
report-not-found | No active, visible report with the id exists in Ramos. |
template-changed | Another request changed the template after it was read, so nothing was saved. Reload the template and try again. |
template-not-found | No template with the given code exists for the current company. |
too-many-attachments | The language already has 20 attachments. |