Get a single contact
Content
Resource URL
https://apps.ticketmatic.com/api/1/{accountname}/contacts/{id}
Description
To retrieve a contact based on the e-mail address, pass 0
as the id and supply an email
parameter.
Example
Request
1use Ticketmatic\Endpoints\Contacts;
2
3$result = Contacts::get($client, $id, array(
4 "email" => "example@ticketmatic.com",
5));
6
7// The parameters array is optional, it can be omitted when empty.
8$result = Contacts::get($client, $id);
Response
1object(\Ticketmatic\Model\Contact) (30) {
2 ["id"]=>
3 int(0)
4 ["addresses"]=>
5 array(1) {
6 [0]=>
7 object(\Ticketmatic\Model\Address) (9) {
8 ["id"]=>
9 int(0)
10 ["typeid"]=>
11 int(0)
12 ["city"]=>
13 string(6) "Leuven"
14 ["country"]=>
15 string(7) "Belgium"
16 ["countrycode"]=>
17 string(2) "BE"
18 ["customerid"]=>
19 int(0)
20 ["street1"]=>
21 string(11) "Main street"
22 ["type"]=>
23 string(4) "Home"
24 ["zip"]=>
25 string(4) "3000"
26 }
27 }
28 ["appnotifications"]=>
29 array(1) {
30 [0]=>
31 int(0)
32 }
33 ["apponboardingstatus"]=>
34 int(0)
35 ["appoptin"]=>
36 object(\Ticketmatic\Model\Appoptin) (5) {
37 ["ip"]=>
38 string(11) "192.168.1.1"
39 ["message"]=>
40 string(8) "I accept"
41 ["method"]=>
42 string(3) "web"
43 ["status"]=>
44 bool(true)
45 ["ts"]=>
46 string(19) "2018-03-26 15:32:17"
47 }
48 ["appphone"]=>
49 string(12) "+32473112233"
50 ["apptoken"]=>
51 string(29) "eyJhbGciOiJSUzI1NiIsInR5cCI6I"
52 ["birthdate"]=>
53 object(\DateTime) (3) {
54 ["date"]=>
55 string(26) "1986-09-26.000000"
56 ["timezone_type"]=>
57 int(3)
58 ["timezone"]=>
59 string(3) "UTC"
60 }
61 ["company"]=>
62 string(9) "Mega Corp"
63 ["customertitleid"]=>
64 int(0)
65 ["email"]=>
66 string(26) "developers@ticketmatic.com"
67 ["firstname"]=>
68 string(4) "John"
69 ["image"]=>
70 string(37) "https://www.ticketmatic.com/image.jpg"
71 ["languagecode"]=>
72 string(2) "NL"
73 ["lastname"]=>
74 string(3) "Doe"
75 ["lookup"]=>
76 array(1) {
77 ["contacts"]=>
78 array(0) {
79 }
80 }
81 ["middlename"]=>
82 string(1) "K"
83 ["optins"]=>
84 array(1) {
85 [0]=>
86 object(\Ticketmatic\Model\ContactOptIn) (5) {
87 ["id"]=>
88 int(0)
89 ["info"]=>
90 object(\Ticketmatic\Model\ContactOptInInfo) (2) {
91 ["method"]=>
92 string(9) "boxoffice"
93 ["remarks"]=>
94 string(32) "The customer accepted the terms."
95 }
96 ["optinid"]=>
97 int(0)
98 ["status"]=>
99 int(0)
100 }
101 }
102 ["organizationfunction"]=>
103 string(21) "Director of ticketing"
104 ["phonenumbers"]=>
105 array(1) {
106 [0]=>
107 object(\Ticketmatic\Model\Phonenumber) (5) {
108 ["id"]=>
109 int(0)
110 ["typeid"]=>
111 int(0)
112 ["customerid"]=>
113 int(0)
114 ["number"]=>
115 string(11) "+3216881940"
116 ["type"]=>
117 string(4) "Home"
118 }
119 }
120 ["relationships"]=>
121 array(1) {
122 [0]=>
123 object(\Ticketmatic\Model\ContactRelationship) (4) {
124 ["id"]=>
125 int(0)
126 ["typeid"]=>
127 int(0)
128 ["childcontactid"]=>
129 int(0)
130 ["parentcontactid"]=>
131 int(0)
132 }
133 }
134 ["relationtypes"]=>
135 array(2) {
136 [0]=>
137 int(0)
138 [1]=>
139 int(0)
140 }
141 ["sendmail"]=>
142 bool(false)
143 ["sex"]=>
144 string(1) "M"
145 ["status"]=>
146 string(10) "incomplete"
147 ["subscribed"]=>
148 bool(false)
149 ["vatnumber"]=>
150 string(11) "BE123456789"
151 ["isdeleted"]=>
152 bool(false)
153 ["createdts"]=>
154 object(\DateTime) (3) {
155 ["date"]=>
156 string(26) "2014-09-26 15:24:36.000000"
157 ["timezone_type"]=>
158 int(3)
159 ["timezone"]=>
160 string(3) "UTC"
161 }
162 ["lastupdatets"]=>
163 object(\DateTime) (3) {
164 ["date"]=>
165 string(26) "2014-09-26 15:24:36.000000"
166 ["timezone_type"]=>
167 int(3)
168 ["timezone"]=>
169 string(3) "UTC"
170 }
171}
Request
1import (
2 "github.com/ticketmatic/tm-go/ticketmatic"
3 "github.com/ticketmatic/tm-go/ticketmatic/contacts"
4)
5
6result, err := contacts.Get(client, id, &ticketmatic.ContactGetQuery{
7 Email: "example@ticketmatic.com",
8})
9
10// The query object is optional, it can be omitted when empty.
11result, err := contacts.Get(client, id, nil)
Response
1result := &ticketmatic.Contact{
2 Id: 9364924,
3 Addresses: []*ticketmatic.Address{
4 &ticketmatic.Address{
5 Id: 28,
6 Typeid: 1,
7 City: "Leuven",
8 Country: "Belgium",
9 Countrycode: "BE",
10 Customerid: 9364924,
11 Street1: "Main street",
12 Type: "Home",
13 Zip: "3000",
14 },
15 },
16 Appnotifications: []int64{
17 31001,
18 },
19 Apponboardingstatus: 32001,
20 Appoptin: &ticketmatic.Appoptin{
21 Ip: "192.168.1.1",
22 Message: "I accept",
23 Method: "web",
24 Status: true,
25 Ts: "2018-03-26 15:32:17",
26 },
27 Appphone: "+32473112233",
28 Apptoken: "eyJhbGciOiJSUzI1NiIsInR5cCI6I",
29 Birthdate: ticketmatic.NewTime(ticketmatic.MustParseTime("1986-09-26")),
30 Company: "Mega Corp",
31 Customertitleid: 12,
32 Email: "developers@ticketmatic.com",
33 Firstname: "John",
34 Image: "https://www.ticketmatic.com/image.jpg",
35 Languagecode: "NL",
36 Lastname: "Doe",
37 Lookup: map[string]interface{}{
38 "contacts": []interface {}{},
39 },
40 Middlename: "K",
41 Optins: []*ticketmatic.ContactOptIn{
42 &ticketmatic.ContactOptIn{
43 Id: 29323,
44 Info: &ticketmatic.ContactOptInInfo{
45 Method: "boxoffice",
46 Remarks: "The customer accepted the terms.",
47 },
48 Optinid: 827,
49 Status: 7602,
50 },
51 },
52 Organizationfunction: "Director of ticketing",
53 Phonenumbers: []*ticketmatic.Phonenumber{
54 &ticketmatic.Phonenumber{
55 Id: 123,
56 Typeid: 3,
57 Customerid: 9364924,
58 Number: "+3216881940",
59 Type: "Home",
60 },
61 },
62 Relationships: []*ticketmatic.ContactRelationship{
63 &ticketmatic.ContactRelationship{
64 Id: 1,
65 Typeid: 47001,
66 Childcontactid: 10000,
67 Parentcontactid: 9364924,
68 },
69 },
70 Relationtypes: []int64{
71 1,
72 2,
73 },
74 Sendmail: false,
75 Sex: "M",
76 Status: "incomplete",
77 Subscribed: false,
78 Vatnumber: "BE123456789",
79 Isdeleted: false,
80 Createdts: ticketmatic.NewTime(ticketmatic.MustParseTime("2014-09-26 15:24:36")),
81 Lastupdatets: ticketmatic.NewTime(ticketmatic.MustParseTime("2014-09-26 15:24:36")),
82}
Request
1GET /api/1/{accountname}/contacts/{id} HTTP/1.1
Response
1HTTP/1.1 200 OK
2Content-Type: application/json
3
4{
5 "id": 9364924,
6 "addresses": [
7 {
8 "id": 28,
9 "typeid": 1,
10 "city": "Leuven",
11 "country": "Belgium",
12 "countrycode": "BE",
13 "customerid": 9364924,
14 "street1": "Main street",
15 "type": "Home",
16 "zip": "3000"
17 }
18 ],
19 "appnotifications": [ 31001 ],
20 "apponboardingstatus": 32001,
21 "appoptin": {
22 "ip": "192.168.1.1",
23 "message": "I accept",
24 "method": "web",
25 "status": true,
26 "ts": "2018-03-26 15:32:17"
27 },
28 "appphone": "+32473112233",
29 "apptoken": "eyJhbGciOiJSUzI1NiIsInR5cCI6I",
30 "birthdate": "1986-09-26",
31 "company": "Mega Corp",
32 "customertitleid": 12,
33 "email": "developers@ticketmatic.com",
34 "firstname": "John",
35 "image": "https://www.ticketmatic.com/image.jpg",
36 "languagecode": "NL",
37 "lastname": "Doe",
38 "lookup": {
39 "contacts": []
40 },
41 "middlename": "K",
42 "optins": [
43 {
44 "id": 29323,
45 "info": {
46 "method": "boxoffice",
47 "remarks": "The customer accepted the terms."
48 },
49 "optinid": 827,
50 "status": 7602
51 }
52 ],
53 "organizationfunction": "Director of ticketing",
54 "phonenumbers": [
55 {
56 "id": 123,
57 "typeid": 3,
58 "customerid": 9364924,
59 "number": "+3216881940",
60 "type": "Home"
61 }
62 ],
63 "relationships": [
64 {
65 "id": 1,
66 "typeid": 47001,
67 "childcontactid": 10000,
68 "parentcontactid": 9364924
69 }
70 ],
71 "relationtypes": [ 1, 2 ],
72 "sendmail": false,
73 "sex": "M",
74 "status": "incomplete",
75 "subscribed": false,
76 "vatnumber": "BE123456789",
77 "isdeleted": false,
78 "createdts": "2014-09-26 15:24:36",
79 "lastupdatets": "2014-09-26 15:24:36"
80}
Parameters
Field | Description |
---|---|
email
|
Type reference: ContactGetQuery
Result fields
Field | Description |
---|---|
id int | Contact ID Example value:9364924 |
addresses Address[] | Addresses Example value:[ { "id": 28, "typeid": 1, "city": "Leuven", "country": "Belgium", "countrycode": "BE", "customerid": 9364924, "street1": "Main street", "type": "Home", "zip": "3000" } ] |
appnotifications int[] | App notifications Example value:[ 31001 ] |
apponboardingstatus int | App onboardingstatus Example value:32001 |
appoptin | App optin Example value:{ "ip": "192.168.1.1", "message": "I accept", "method": "web", "status": true, "ts": "2018-03-26 15:32:17" } |
appphone string | App phone Example value:"+32473112233" |
apptoken string | App token Example value:"eyJhbGciOiJSUzI1NiIsInR5cCI6I" |
birthdate timestamp | Birth date Example value:"1986-09-26" |
company string | Company Example value:"Mega Corp" |
customertitleid int | Customer title ID (also determines the gender of the contact) Example value:12 |
email string | E-mail address Example value:"developers@ticketmatic.com" |
firstname string | First name Example value:"John" |
image string | Image url Example value:"https://www.ticketmatic.com/image.jpg" |
languagecode string | Language (ISO 639-1 code) Example value:"NL" |
lastname string | Last name Example value:"Doe" |
lookup map<string, mixed> | Related objects Example value:{ "contacts": [] } |
middlename string | Middle name Example value:"K" |
optins | A list of opt ins Example value:[ { "id": 29323, "info": { "method": "boxoffice", "remarks": "The customer accepted the terms." }, "optinid": 827, "status": 7602 } ] |
organizationfunction string | Job function Example value:"Director of ticketing" |
phonenumbers | Phone numbers Example value:[ { "id": 123, "typeid": 3, "customerid": 9364924, "number": "+3216881940", "type": "Home" } ] |
relationships | A list of contact relationships Example value:[ { "id": 1, "typeid": 47001, "childcontactid": 10000, "parentcontactid": 9364924 } ] |
relationtypes int[] | Relation type IDs Example value:[ 1, 2 ] |
sendmail bool | |
sex string | Sex Example value:"M" |
status string | Contact status Possible values:
"incomplete" |
subscribed bool | Whether or not this contact is subscribed in the e-mail marketing integration |
vatnumber string | VAT Number (for organizations) Example value:"BE123456789" |
isdeleted bool | Whether or not this contact has been deleted |
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: Contact