Get a single 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::get($client, $id);

Response

 1object(\Ticketmatic\Model\Report) (19) {
 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  ["options"]=>
53  object(\Ticketmatic\Model\ReportOptions) (1) {
54    ["pdfpagesize"]=>
55    string(2) "A4"
56  }
57  ["reporttypeid"]=>
58  int(0)
59  ["subtitles"]=>
60  array(2) {
61    [0]=>
62    string(10) "Subtitle 1"
63    [1]=>
64    string(10) "Subtitle 2"
65  }
66  ["translations"]=>
67  array(2) {
68    ["en"]=>
69    string(3) "..."
70    ["nl"]=>
71    string(3) "..."
72  }
73  ["usagetypeid"]=>
74  int(0)
75  ["createdts"]=>
76  object(\DateTime) (3) {
77    ["date"]=>
78    string(26) "2014-09-26 15:24:36.000000"
79    ["timezone_type"]=>
80    int(3)
81    ["timezone"]=>
82    string(3) "UTC"
83  }
84  ["lastupdatets"]=>
85  object(\DateTime) (3) {
86    ["date"]=>
87    string(26) "2014-09-26 15:24:36.000000"
88    ["timezone_type"]=>
89    int(3)
90    ["timezone"]=>
91    string(3) "UTC"
92  }
93}
94

Request

1import (
2    "github.com/ticketmatic/tm-go/ticketmatic"
3    "github.com/ticketmatic/tm-go/ticketmatic/settings/system/reports"
4)
5
6result, err := reports.Get(client, id)

Response

 1result := &ticketmatic.Report{
 2    Id: 123,
 3    Name: "Financial overview",
 4    Content: [][]map[string]interface{}{
 5        []map[string]interface{}{
 6            map[string]interface{}{
 7                "columns": []interface {}{map[string]interface {}{"caption":"Id", "width":"80px"}, map[string]interface {}{"caption":"Naam"}},
 8                "query": "select id,namenl as name from ev.event",
 9                "type": "table",
10            },
11        },
12    },
13    Defaultformat: "pdf",
14    Description: "A financial overview per month for the last 12 months",
15    Emailbcc: "info@mycompany.be;management@mycompany.be",
16    Emailcc: "info@mycompany.be;management@mycompany.be",
17    Emailrecipients: "info@mycompany.be;management@mycompany.be",
18    Emailschedule: false,
19    Emailscheduledayofmonth: 1,
20    Emailscheduledayofweek: 7,
21    Emailschedulehourofday: 8,
22    Options: &ticketmatic.ReportOptions{
23        Pdfpagesize: "A4",
24    },
25    Reporttypeid: 1,
26    Subtitles: []string{
27        "Subtitle 1",
28        "Subtitle 2",
29    },
30    Translations: map[string]string{
31        "en": "...",
32        "nl": "...",
33    },
34    Usagetypeid: 17001,
35    Createdts: ticketmatic.NewTime(ticketmatic.MustParseTime("2014-09-26 15:24:36")),
36    Lastupdatets: ticketmatic.NewTime(ticketmatic.MustParseTime("2014-09-26 15:24:36")),
37}

Request

1GET /api/1/{accountname}/settings/system/reports/{id} HTTP/1.1

Response

 1HTTP/1.1 200 OK
 2Content-Type: application/json
 3
 4{
 5    "id": 123,
 6    "name": "Financial overview",
 7    "content": [
 8        [
 9            {
10                "columns": [
11                    {
12                        "caption": "Id",
13                        "width": "80px"
14                    },
15                    {
16                        "caption": "Naam"
17                    }
18                ],
19                "query": "select id,namenl as name from ev.event",
20                "type": "table"
21            }
22        ]
23    ],
24    "defaultformat": "pdf",
25    "description": "A financial overview per month for the last 12 months",
26    "emailbcc": "info@mycompany.be;management@mycompany.be",
27    "emailcc": "info@mycompany.be;management@mycompany.be",
28    "emailrecipients": "info@mycompany.be;management@mycompany.be",
29    "emailschedule": false,
30    "emailscheduledayofmonth": 1,
31    "emailscheduledayofweek": 7,
32    "emailschedulehourofday": 8,
33    "options": {
34        "pdfpagesize": "A4"
35    },
36    "reporttypeid": 1,
37    "subtitles": [
38        "Subtitle 1",
39        "Subtitle 2"
40    ],
41    "translations": {
42        "en": "...",
43        "nl": "..."
44    },
45    "usagetypeid": 17001,
46    "createdts": "2014-09-26 15:24:36",
47    "lastupdatets": "2014-09-26 15:24:36"
48}

Result fields

FieldDescription
id
int

Unique ID

Example value:123
name

Name of the report

Example value:"Financial overview"
content
map<string, mixed>[][]

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
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