REST Interface

REST Interface

Included in the bundle is a REST interface called Reporter REST Interface that allows you to request an email to be sent with a created PDF attached. This chapter describes the API in more detail.

Syntax:
{
"action": "sendPDF",
"recordType": <RECORDTYPE>,
"recordId":
<RECORDID>,
"layoutId":
<LAYOUTID>,
"attachtorec":
<ATTACHTOREC>,
"recipient":
<RECIPIENT>,
"cc":
<CC>,
"bcc": <
BCC>,
"subject":
<SUBJECT>,
"message":
<MESSAGE>,
"author":
<AUHTOR>,
"availableOnLine":
<AVAILABLEONLINE>,
"indata": {

<PARAM_NAME> : <PARAM_VALUE>,...
}

}

JSON Properties

  • action: must be "sendPDF".

  • recordType: Record type for selected layout.

  • recordId: Internal id of record.

  • layoutId: Internal id of layout.

  • attachtorec: If checked, the created file will be attached and visible on the files section on the record.

  • recipient: Is used, make sure Send To Contact is empty.

  • cc: Optional. Used for carbon copy. Multiple email addresses can be entered separated by comma.

  • bcc: Optional. Used for blind carbon copy. Multiple email addresses can be entered separated by comma.

  • subject: The subject of the email sent.

  • message: The message of the email.

  • author: The internal id of the employee record that should be set as the author of the email sent.

  • availableOnLine: Used if created PDF document should be available without login.

  • indata:

Example:
{
"action": "sendPDF",
"recordType": "customer",
"recordid": "75",
"layoutId": "4",
"attachtorec": true,
"recipient": "20",
"cc": "
first1.lastname1@cc.com, first2.lastname2@cc.com",
"bcc": "first3.lastname3@bcc.com",
"subject": "Your Invoice",
"message": "See attached invoice. Kind regards, SuiteCorner AB",
"author": "4",
"
availableOnLine": true,
"indata": [

{"name":"custpage_show_trx_details","value":"T"},
{"name":"custpage_trx_creation_date","value":"2010-8-8"}
]
};