Get a single document

Content

Resource URL

https://apps.ticketmatic.com/api/1/{accountname}/settings/communicationanddesign/documents/{id}

Example

Request

1use Ticketmatic\Endpoints\Settings\Communicationanddesign\Documents;
2
3$result = Documents::get($client, $id);

Response

 1object(\Ticketmatic\Model\Document) (9) {
 2  ["id"]=>
 3  int(0)
 4  ["typeid"]=>
 5  int(0)
 6  ["name"]=>
 7  string(7) "Invoice"
 8  ["css"]=>
 9  string(80) "@page {
10    padding: 0;
11    margin: 0pt 0pt 0pt 0pt;
12    size: 152mm 82mm;
13}"
14  ["description"]=>
15  string(16) "Invoice document"
16  ["htmltemplate"]=>
17  string(64) "<html><head><meta charset="UTF-8"><\/head><body><\/body><\/html>"
18  ["translations"]=>
19  array(2) {
20    ["en"]=>
21    string(3) "..."
22    ["nl"]=>
23    string(3) "..."
24  }
25  ["createdts"]=>
26  object(\DateTime) (3) {
27    ["date"]=>
28    string(26) "2014-09-26 15:24:36.000000"
29    ["timezone_type"]=>
30    int(3)
31    ["timezone"]=>
32    string(3) "UTC"
33  }
34  ["lastupdatets"]=>
35  object(\DateTime) (3) {
36    ["date"]=>
37    string(26) "2014-09-26 15:24:36.000000"
38    ["timezone_type"]=>
39    int(3)
40    ["timezone"]=>
41    string(3) "UTC"
42  }
43}
44

Request

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

Response

 1result := &ticketmatic.Document{
 2    Id: 123,
 3    Typeid: 10001,
 4    Name: "Invoice",
 5    Css: "@page {\r\n    padding: 0;\r\n    margin: 0pt 0pt 0pt 0pt;\r\n    size: 152mm 82mm;\r\n}",
 6    Description: "Invoice document",
 7    Htmltemplate: "<html><head><meta charset=\"UTF-8\"><\\/head><body><\\/body><\\/html>",
 8    Translations: map[string]string{
 9        "en": "...",
10        "nl": "...",
11    },
12    Createdts: ticketmatic.NewTime(ticketmatic.MustParseTime("2014-09-26 15:24:36")),
13    Lastupdatets: ticketmatic.NewTime(ticketmatic.MustParseTime("2014-09-26 15:24:36")),
14}

Request

1GET /api/1/{accountname}/settings/communicationanddesign/documents/{id} HTTP/1.1

Response

 1HTTP/1.1 200 OK
 2Content-Type: application/json
 3
 4{
 5    "id": 123,
 6    "typeid": 10001,
 7    "name": "Invoice",
 8    "css": "@page {
 9    padding: 0;
10    margin: 0pt 0pt 0pt 0pt;
11    size: 152mm 82mm;
12}",
13    "description": "Invoice document",
14    "htmltemplate": "<html><head><meta charset="UTF-8"><\/head><body><\/body><\/html>",
15    "translations": {
16        "en": "...",
17        "nl": "..."
18    },
19    "createdts": "2014-09-26 15:24:36",
20    "lastupdatets": "2014-09-26 15:24:36"
21}

Result fields

FieldDescription
id
int

Unique ID

Example value:123
typeid
int

Type ID

Example value:10001
name

Name of the document

Example value:"Invoice"
css
string

Css content for the document template

Example value:"@page { padding: 0; margin: 0pt 0pt 0pt 0pt; size: 152mm 82mm; }"
description

Description of the document

Example value:"Invoice document"
htmltemplate
string

HTML content for the document template

Example value:"<html><head><meta charset="UTF-8"><\/head><body><\/body><\/html>"
translations
map<string, string>

Translations for the document template

Example value:{ "en": "...", "nl": "..." }
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: Document