Modify an existing report
Content
Resource URL
https://apps.ticketmatic.com/api/1/{accountname}/settings/system/reports/{id}
Example
Request
1use Ticketmatic\Endpoints\Settings\System\Reports;
2
3$result = Reports::update($client, $id, array(
4 "name" => "Financial overview",
5 "content" => array(
6 array(
7 array(
8 "columns" => array(
9 array(
10 "caption" => "Id",
11 "width" => "80px",
12 ),
13 array(
14 "caption" => "Naam",
15 ),
16 ),
17 "query" => "select id,namenl as name from ev.event",
18 "type" => "table",
19 ),
20 ),
21 ),
22 "defaultformat" => "pdf",
23 "description" => "A financial overview per month for the last 12 months",
24 "emailbcc" => "info@mycompany.be;management@mycompany.be",
25 "emailcc" => "info@mycompany.be;management@mycompany.be",
26 "emailrecipients" => "info@mycompany.be;management@mycompany.be",
27 "emailschedule" => false,
28 "emailscheduledayofmonth" => 1,
29 "emailscheduledayofweek" => 7,
30 "emailschedulehourofday" => 8,
31 "emailschedulequery" => "select * from op.basket where createdts > CURRENT_TIMESTAMP - INTERVAL '1 DAY'",
32 "options" => array(
33 "pdfpagesize" => "A4",
34 ),
35 "reporttypeid" => 1,
36 "subtitles" => array(
37 "Subtitle 1",
38 "Subtitle 2",
39 ),
40 "translations" => array(
41 "en" => "...",
42 "nl" => "...",
43 ),
44 "usagetypeid" => 17001,
45));
Response
1object(\Ticketmatic\Model\Report) (20) {
2 ["id"]=>
3 int(0)
4 ["name"]=>
5 string(18) "Financial overview"
6 ["content"]=>
7 array(1) {
8 [0]=>
9 array(1) {
10 [0]=>
11 array(3) {
12 ["columns"]=>
13 array(2) {
14 [0]=>
15 array(2) {
16 ["caption"]=>
17 string(2) "Id"
18 ["width"]=>
19 string(4) "80px"
20 }
21 [1]=>
22 array(1) {
23 ["caption"]=>
24 string(4) "Naam"
25 }
26 }
27 ["query"]=>
28 string(38) "select id,namenl as name from ev.event"
29 ["type"]=>
30 string(5) "table"
31 }
32 }
33 }
34 ["defaultformat"]=>
35 string(3) "pdf"
36 ["description"]=>
37 string(53) "A financial overview per month for the last 12 months"
38 ["emailbcc"]=>
39 string(41) "info@mycompany.be;management@mycompany.be"
40 ["emailcc"]=>
41 string(41) "info@mycompany.be;management@mycompany.be"
42 ["emailrecipients"]=>
43 string(41) "info@mycompany.be;management@mycompany.be"
44 ["emailschedule"]=>
45 bool(false)
46 ["emailscheduledayofmonth"]=>
47 int(0)
48 ["emailscheduledayofweek"]=>
49 int(0)
50 ["emailschedulehourofday"]=>
51 int(0)
52 ["emailschedulequery"]=>
53 string(78) "select * from op.basket where createdts > CURRENT_TIMESTAMP - INTERVAL '1 DAY'"
54 ["options"]=>
55 object(\Ticketmatic\Model\ReportOptions) (1) {
56 ["pdfpagesize"]=>
57 string(2) "A4"
58 }
59 ["reporttypeid"]=>
60 int(0)
61 ["subtitles"]=>
62 array(2) {
63 [0]=>
64 string(10) "Subtitle 1"
65 [1]=>
66 string(10) "Subtitle 2"
67 }
68 ["translations"]=>
69 array(2) {
70 ["en"]=>
71 string(3) "..."
72 ["nl"]=>
73 string(3) "..."
74 }
75 ["usagetypeid"]=>
76 int(0)
77 ["createdts"]=>
78 object(\DateTime) (3) {
79 ["date"]=>
80 string(26) "2014-09-26 15:24:36.000000"
81 ["timezone_type"]=>
82 int(3)
83 ["timezone"]=>
84 string(3) "UTC"
85 }
86 ["lastupdatets"]=>
87 object(\DateTime) (3) {
88 ["date"]=>
89 string(26) "2014-09-26 15:24:36.000000"
90 ["timezone_type"]=>
91 int(3)
92 ["timezone"]=>
93 string(3) "UTC"
94 }
95}
Request body fields
Field | Description |
---|---|
name mlstring (required) | Name of the report Example value:"Financial overview" |
content | The actual report definition, see reports for more information. Example value:[ [ { "columns": [ { "caption": "Id", "width": "80px" }, { "caption": "Naam" } ], "query": "select id,namenl as name from ev.event", "type": "table" } ] ] |
defaultformat string (required) | Reports can be generated as pdf or excel file. This field defines the default format. Possible values are ‘pdf’ or ‘excel’ Example value:"pdf" |
description mlstring (required) | Description of the report Example value:"A financial overview per month for the last 12 months" |
emailbcc string (required) | List of email recipients that should receive the report in bcc, separated by ; Example value:"info@mycompany.be;management@mycompany.be" |
emailcc string (required) | List of email recipients that should receive the report in cc, separated by ; Example value:"info@mycompany.be;management@mycompany.be" |
emailrecipients string (required) | List of email recipients that should receive the report, separated by ; Example value:"info@mycompany.be;management@mycompany.be" |
emailschedule bool (required) | Indicates if this report is scheduled to be sent by mail at a certain interval
|
Type reference: Report
Result fields
Field | Description |
---|---|
id int | Unique ID Example value:123 |
name | Name of the report Example value:"Financial overview" |
content | The actual report definition, see reports for more information. Example value:[ [ { "columns": [ { "caption": "Id", "width": "80px" }, { "caption": "Naam" } ], "query": "select id,namenl as name from ev.event", "type": "table" } ] ] |
defaultformat string | Reports can be generated as pdf or excel file. This field defines the default format. Possible values are ‘pdf’ or ‘excel’ Example value:"pdf" |
description | Description of the report Example value:"A financial overview per month for the last 12 months" |
emailbcc string | List of email recipients that should receive the report in bcc, separated by ; Example value:"info@mycompany.be;management@mycompany.be" |
emailcc string | List of email recipients that should receive the report in cc, separated by ; Example value:"info@mycompany.be;management@mycompany.be" |
emailrecipients string | List of email recipients that should receive the report, separated by ; Example value:"info@mycompany.be;management@mycompany.be" |
emailschedule bool | Indicates if this report is scheduled to be sent by mail at a certain interval |
emailscheduledayofmonth int | Day of the month the report will be sent. Example value:1 |
emailscheduledayofweek int | Day of the week the report will be sent. 1 = monday -> 7 = sunday Example value:7 |
emailschedulehourofday int | Hour of the day the report will be sent Example value:8 |
emailschedulequery string | Report will only be sent if the given query returns at least one result. Example value:"select * from op.basket where createdts > CURRENT_TIMESTAMP - INTERVAL '1 DAY'" |
options | Key-value array of options. Can contain: pdfpagesize, excelpagewidth, excelscaling, usesystemfont Example value:{ "pdfpagesize": "A4" } |
reporttypeid int | The report type defines the UI and parameters that are used when generating the report Example value:1 |
subtitles string[] | A list of subtitles for the report Example value:[ "Subtitle 1", "Subtitle 2" ] |
translations map<string, string> | A map of language codes to gettext .po files. Example value:{ "en": "...", "nl": "..." } |
usagetypeid int | Indicates where the report is being used. Possible values: 17001 (Sales), 17002 (External sales), 17003 (Hidden) Example value:17001 |
createdts timestamp | Created timestamp Example value:"2014-09-26 15:24:36" |
lastupdatets timestamp | Last updated timestamp Example value:"2014-09-26 15:24:36" |
Type reference: Report