How To Use The Rest API End Point - Reports And Letters
WARNING: This end-point is currently in development and incomplete.
At present, the only supported destinations are SVG and CSV.
Use this end-point to run a report or letter in Collect!. For the printer destination, you would
use SVG. Collect! returns an SVG image in the Response Body that can then be used to send to the
printer.
Reports that stop and prompt the user for information will require a Web Socket ID passed in the
'websocket-id' field of the request body. If you are unsure about whether the reports has prompting,
then it is best practice to always open a Web Socket connection. Please see Web Sockets above.
If the report needs to use a Web Socket, and fails to do so, the plan will fail. Any changes
made to the database by the report, up to that point, will be rolled back.
This is the name of the report or letter to run. This is optional, if script is populated,
but required if script is blank (or not supplied).
script
Scripts are report code that can execute directly or alter reports. If a script is supplied,
and the report is blank (or not supplied), then the script will execute as is. If a script
and report are both supplied, the script is prepended to the top of the report body.
starton
This is the record type that must be active for a report or letter to be run. For example,
letters printed to a Debtor would be "starton":"debtor" and letters printed to a Client would
be "starton":"client" If Start On is not supplied, then the Report's Start On is used. If a
Report Start On were not supplied (IE: just a script), then the the Start On is set to
Anywhere.
rowid
This is an array, even if it's just a single value. The array should be a list of rowid's
to run the report or letter on.
websocket-id
This is the web socket ID for the applicable socket connection.
destination
This is the output destination to receive in the response. All data is returned as JSON,
including file type destinations.
showmargins
This is a true/false option to enable gridlines. When enabled, Margins and Rectangles in
the report will display in the output for the SVG destination. This is useful for layout
testing. The background grid is in major intervals of 1 inch and minor intervals of
0.5 inches.
Examples
Note that Contact Plans only work for Debtor, Client, Cosigner, and Associate.
Was this page helpful? Do you have any comments on this document? Can we make it better? If so how may we improve this page.
Please click this link to send us your comments: helpinfo@collect.org