Get a list of contacts

Content

Resource URL

https://apps.ticketmatic.com/api/1/{accountname}/contacts

Example

Request

 1use Ticketmatic\Endpoints\Contacts;
 2
 3$result = Contacts::getlist($client, array(
 4    "filter" => "select id from tm.contact where firstname = 'Ruben'",
 5    "includearchived" => false,
 6    "lastupdatesince" => "2014-09-26 15:24:36",
 7    "limit" => 100,
 8    "offset" => 100,
 9    "orderby" => "name",
10    "output" => "default",
11    "searchterm" => "John",
12));
13
14// The parameters array is optional, it can be omitted when empty.
15$result = Contacts::getlist($client);

Response

  1object(Ticketmatic\Endpoints\ContactsList) (1) {
  2  ["data"]=>
  3  array(1) {
  4    [0]=>
  5    object(\Ticketmatic\Model\Contact) (30) {
  6      ["id"]=>
  7      int(0)
  8      ["addresses"]=>
  9      array(1) {
 10        [0]=>
 11        object(\Ticketmatic\Model\Address) (9) {
 12          ["id"]=>
 13          int(0)
 14          ["typeid"]=>
 15          int(0)
 16          ["city"]=>
 17          string(6) "Leuven"
 18          ["country"]=>
 19          string(7) "Belgium"
 20          ["countrycode"]=>
 21          string(2) "BE"
 22          ["customerid"]=>
 23          int(0)
 24          ["street1"]=>
 25          string(11) "Main street"
 26          ["type"]=>
 27          string(4) "Home"
 28          ["zip"]=>
 29          string(4) "3000"
 30        }
 31      }
 32      ["appnotifications"]=>
 33      array(1) {
 34        [0]=>
 35        int(0)
 36      }
 37      ["apponboardingstatus"]=>
 38      int(0)
 39      ["appoptin"]=>
 40      object(\Ticketmatic\Model\Appoptin) (5) {
 41        ["ip"]=>
 42        string(11) "192.168.1.1"
 43        ["message"]=>
 44        string(8) "I accept"
 45        ["method"]=>
 46        string(3) "web"
 47        ["status"]=>
 48        bool(true)
 49        ["ts"]=>
 50        string(19) "2018-03-26 15:32:17"
 51      }
 52      ["appphone"]=>
 53      string(12) "+32473112233"
 54      ["apptoken"]=>
 55      string(29) "eyJhbGciOiJSUzI1NiIsInR5cCI6I"
 56      ["birthdate"]=>
 57      object(\DateTime) (3) {
 58        ["date"]=>
 59        string(26) "1986-09-26.000000"
 60        ["timezone_type"]=>
 61        int(3)
 62        ["timezone"]=>
 63        string(3) "UTC"
 64      }
 65      ["company"]=>
 66      string(9) "Mega Corp"
 67      ["customertitleid"]=>
 68      int(0)
 69      ["email"]=>
 70      string(26) "developers@ticketmatic.com"
 71      ["firstname"]=>
 72      string(4) "John"
 73      ["image"]=>
 74      string(37) "https://www.ticketmatic.com/image.jpg"
 75      ["languagecode"]=>
 76      string(2) "NL"
 77      ["lastname"]=>
 78      string(3) "Doe"
 79      ["lookup"]=>
 80      array(1) {
 81        ["contacts"]=>
 82          array(0) {
 83          }
 84      }
 85      ["middlename"]=>
 86      string(1) "K"
 87      ["optins"]=>
 88      array(1) {
 89        [0]=>
 90        object(\Ticketmatic\Model\ContactOptIn) (5) {
 91          ["id"]=>
 92          int(0)
 93          ["info"]=>
 94          object(\Ticketmatic\Model\ContactOptInInfo) (2) {
 95            ["method"]=>
 96            string(9) "boxoffice"
 97            ["remarks"]=>
 98            string(32) "The customer accepted the terms."
 99          }
100          ["optinid"]=>
101          int(0)
102          ["status"]=>
103          int(0)
104        }
105      }
106      ["organizationfunction"]=>
107      string(21) "Director of ticketing"
108      ["phonenumbers"]=>
109      array(1) {
110        [0]=>
111        object(\Ticketmatic\Model\Phonenumber) (5) {
112          ["id"]=>
113          int(0)
114          ["typeid"]=>
115          int(0)
116          ["customerid"]=>
117          int(0)
118          ["number"]=>
119          string(11) "+3216881940"
120          ["type"]=>
121          string(4) "Home"
122        }
123      }
124      ["relationships"]=>
125      array(1) {
126        [0]=>
127        object(\Ticketmatic\Model\ContactRelationship) (4) {
128          ["id"]=>
129          int(0)
130          ["typeid"]=>
131          int(0)
132          ["childcontactid"]=>
133          int(0)
134          ["parentcontactid"]=>
135          int(0)
136        }
137      }
138      ["relationtypes"]=>
139      array(2) {
140        [0]=>
141        int(0)
142        [1]=>
143        int(0)
144      }
145      ["sendmail"]=>
146      bool(false)
147      ["sex"]=>
148      string(1) "M"
149      ["status"]=>
150      string(10) "incomplete"
151      ["subscribed"]=>
152      bool(false)
153      ["vatnumber"]=>
154      string(11) "BE123456789"
155      ["isdeleted"]=>
156      bool(false)
157      ["createdts"]=>
158      object(\DateTime) (3) {
159        ["date"]=>
160        string(26) "2014-09-26 15:24:36.000000"
161        ["timezone_type"]=>
162        int(3)
163        ["timezone"]=>
164        string(3) "UTC"
165      }
166      ["lastupdatets"]=>
167      object(\DateTime) (3) {
168        ["date"]=>
169        string(26) "2014-09-26 15:24:36.000000"
170        ["timezone_type"]=>
171        int(3)
172        ["timezone"]=>
173        string(3) "UTC"
174      }
175    }
176  }
177}

Request

 1import (
 2    "github.com/ticketmatic/tm-go/ticketmatic"
 3    "github.com/ticketmatic/tm-go/ticketmatic/contacts"
 4)
 5
 6result, err := contacts.Getlist(client, &ticketmatic.ContactQuery{
 7    Filter: "select id from tm.contact where firstname = 'Ruben'",
 8    Includearchived: false,
 9    Lastupdatesince: ticketmatic.NewTime(ticketmatic.MustParseTime("2014-09-26 15:24:36")),
10    Limit: 100,
11    Offset: 100,
12    Orderby: "name",
13    Output: "default",
14    Searchterm: "John",
15})
16
17// The query object is optional, it can be omitted when empty.
18result, err := contacts.Getlist(client, nil)

Response

 1result := contacts.&List{
 2    Data: []*ticketmatic.Contact{
 3        &ticketmatic.Contact{
 4            Id: 9364924,
 5            Addresses: []*ticketmatic.Address{
 6                &ticketmatic.Address{
 7                    Id: 28,
 8                    Typeid: 1,
 9                    City: "Leuven",
10                    Country: "Belgium",
11                    Countrycode: "BE",
12                    Customerid: 9364924,
13                    Street1: "Main street",
14                    Type: "Home",
15                    Zip: "3000",
16                },
17            },
18            Appnotifications: []int64{
19                31001,
20            },
21            Apponboardingstatus: 32001,
22            Appoptin: &ticketmatic.Appoptin{
23                Ip: "192.168.1.1",
24                Message: "I accept",
25                Method: "web",
26                Status: true,
27                Ts: "2018-03-26 15:32:17",
28            },
29            Appphone: "+32473112233",
30            Apptoken: "eyJhbGciOiJSUzI1NiIsInR5cCI6I",
31            Birthdate: ticketmatic.NewTime(ticketmatic.MustParseTime("1986-09-26")),
32            Company: "Mega Corp",
33            Customertitleid: 12,
34            Email: "developers@ticketmatic.com",
35            Firstname: "John",
36            Image: "https://www.ticketmatic.com/image.jpg",
37            Languagecode: "NL",
38            Lastname: "Doe",
39            Lookup: map[string]interface{}{
40                "contacts": []interface {}{},
41            },
42            Middlename: "K",
43            Optins: []*ticketmatic.ContactOptIn{
44                &ticketmatic.ContactOptIn{
45                    Id: 29323,
46                    Info: &ticketmatic.ContactOptInInfo{
47                        Method: "boxoffice",
48                        Remarks: "The customer accepted the terms.",
49                    },
50                    Optinid: 827,
51                    Status: 7602,
52                },
53            },
54            Organizationfunction: "Director of ticketing",
55            Phonenumbers: []*ticketmatic.Phonenumber{
56                &ticketmatic.Phonenumber{
57                    Id: 123,
58                    Typeid: 3,
59                    Customerid: 9364924,
60                    Number: "+3216881940",
61                    Type: "Home",
62                },
63            },
64            Relationships: []*ticketmatic.ContactRelationship{
65                &ticketmatic.ContactRelationship{
66                    Id: 1,
67                    Typeid: 47001,
68                    Childcontactid: 10000,
69                    Parentcontactid: 9364924,
70                },
71            },
72            Relationtypes: []int64{
73                1,
74                2,
75            },
76            Sendmail: false,
77            Sex: "M",
78            Status: "incomplete",
79            Subscribed: false,
80            Vatnumber: "BE123456789",
81            Isdeleted: false,
82            Createdts: ticketmatic.NewTime(ticketmatic.MustParseTime("2014-09-26 15:24:36")),
83            Lastupdatets: ticketmatic.NewTime(ticketmatic.MustParseTime("2014-09-26 15:24:36")),
84        },
85    },
86}

Request

1GET /api/1/{accountname}/contacts HTTP/1.1

Response

 1HTTP/1.1 200 OK
 2Content-Type: application/json
 3
 4{
 5    "data": [
 6        {
 7            "id": 9364924,
 8            "addresses": [
 9                {
10                    "id": 28,
11                    "typeid": 1,
12                    "city": "Leuven",
13                    "country": "Belgium",
14                    "countrycode": "BE",
15                    "customerid": 9364924,
16                    "street1": "Main street",
17                    "type": "Home",
18                    "zip": "3000"
19                }
20            ],
21            "appnotifications": [ 31001 ],
22            "apponboardingstatus": 32001,
23            "appoptin": {
24                "ip": "192.168.1.1",
25                "message": "I accept",
26                "method": "web",
27                "status": true,
28                "ts": "2018-03-26 15:32:17"
29            },
30            "appphone": "+32473112233",
31            "apptoken": "eyJhbGciOiJSUzI1NiIsInR5cCI6I",
32            "birthdate": "1986-09-26",
33            "company": "Mega Corp",
34            "customertitleid": 12,
35            "email": "developers@ticketmatic.com",
36            "firstname": "John",
37            "image": "https://www.ticketmatic.com/image.jpg",
38            "languagecode": "NL",
39            "lastname": "Doe",
40            "lookup": {
41                "contacts": []
42            },
43            "middlename": "K",
44            "optins": [
45                {
46                    "id": 29323,
47                    "info": {
48                        "method": "boxoffice",
49                        "remarks": "The customer accepted the terms."
50                    },
51                    "optinid": 827,
52                    "status": 7602
53                }
54            ],
55            "organizationfunction": "Director of ticketing",
56            "phonenumbers": [
57                {
58                    "id": 123,
59                    "typeid": 3,
60                    "customerid": 9364924,
61                    "number": "+3216881940",
62                    "type": "Home"
63                }
64            ],
65            "relationships": [
66                {
67                    "id": 1,
68                    "typeid": 47001,
69                    "childcontactid": 10000,
70                    "parentcontactid": 9364924
71                }
72            ],
73            "relationtypes": [ 1, 2 ],
74            "sendmail": false,
75            "sex": "M",
76            "status": "incomplete",
77            "subscribed": false,
78            "vatnumber": "BE123456789",
79            "isdeleted": false,
80            "createdts": "2014-09-26 15:24:36",
81            "lastupdatets": "2014-09-26 15:24:36"
82        }
83    ]
84}

Parameters

FieldDescription
filter
string

A SQL query that returns contact IDs

Can be used to do arbitrary filtering. See the database documentation for contact for more information.

Example value:"select id from tm.contact where firstname = 'Ruben'"
includearchived
bool

If this parameter is true, archived items will be returned as well.

lastupdatesince
timestamp

Only include contacts that have been updated since the given timestamp.

Example value:"2014-09-26 15:24:36"
limit
int

Limit results to at most the given amount of contacts.

Example value:100
offset
int

Skip the first X contacts.

Example value:100
orderby
string

Order by the given field.

Supported values: name, lastupdatets, createdts.

Example value:"name"
output
string

Output format.

Possible values:

  • ids: Only fill the ID field
  • minimal: A minimal set of order fields
  • default: Return all order fields (also used when the output parameter is omitted)
Example value:"default"
searchterm
string

A text filter string.

Matches against the contact name and contact details.

Example value:"John"

Type reference: ContactQuery

Result fields

This call returns an object with an array of objects in the data field.

FieldDescription
id
int

Contact ID

Example value:9364924
addresses

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:

  • deleted: Contact has been deleted
  • incomplete: Contact misses crucial account information
  • (blank): Normal contact
Example value:"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"

This type can have custom fields.

Type reference: Contact[]