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) (21) {
  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  ["birthdate"]=>
 29  object(\DateTime) (3) {
 30    ["date"]=>
 31    string(26) "1986-09-26.000000"
 32    ["timezone_type"]=>
 33    int(3)
 34    ["timezone"]=>
 35    string(3) "UTC"
 36  }
 37  ["company"]=>
 38  string(9) "Mega Corp"
 39  ["customertitleid"]=>
 40  int(0)
 41  ["email"]=>
 42  string(26) "developers@ticketmatic.com"
 43  ["firstname"]=>
 44  string(4) "John"
 45  ["languagecode"]=>
 46  string(2) "NL"
 47  ["lastname"]=>
 48  string(3) "Doe"
 49  ["middlename"]=>
 50  string(1) "K"
 51  ["optins"]=>
 52  array(1) {
 53    [0]=>
 54    object(\Ticketmatic\Model\ContactOptIn) (5) {
 55      ["id"]=>
 56      int(0)
 57      ["info"]=>
 58      object(\Ticketmatic\Model\ContactOptInInfo) (2) {
 59        ["method"]=>
 60        string(9) "boxoffice"
 61        ["remarks"]=>
 62        string(32) "The customer accepted the terms."
 63      }
 64      ["optinid"]=>
 65      int(0)
 66      ["status"]=>
 67      int(0)
 68    }
 69  }
 70  ["organizationfunction"]=>
 71  string(21) "Director of ticketing"
 72  ["phonenumbers"]=>
 73  array(1) {
 74    [0]=>
 75    object(\Ticketmatic\Model\Phonenumber) (5) {
 76      ["id"]=>
 77      int(0)
 78      ["typeid"]=>
 79      int(0)
 80      ["customerid"]=>
 81      int(0)
 82      ["number"]=>
 83      string(11) "+3216881940"
 84      ["type"]=>
 85      string(4) "Home"
 86    }
 87  }
 88  ["relationtypes"]=>
 89  array(2) {
 90    [0]=>
 91    int(0)
 92    [1]=>
 93    int(0)
 94  }
 95  ["sex"]=>
 96  string(1) "M"
 97  ["status"]=>
 98  string(10) "incomplete"
 99  ["subscribed"]=>
100  bool(false)
101  ["vatnumber"]=>
102  string(11) "BE123456789"
103  ["isdeleted"]=>
104  bool(false)
105  ["createdts"]=>
106  object(\DateTime) (3) {
107    ["date"]=>
108    string(26) "2014-09-26 15:24:36.000000"
109    ["timezone_type"]=>
110    int(3)
111    ["timezone"]=>
112    string(3) "UTC"
113  }
114  ["lastupdatets"]=>
115  object(\DateTime) (3) {
116    ["date"]=>
117    string(26) "2014-09-26 15:24:36.000000"
118    ["timezone_type"]=>
119    int(3)
120    ["timezone"]=>
121    string(3) "UTC"
122  }
123}
124

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    Birthdate: ticketmatic.NewTime(ticketmatic.MustParseTime("1986-09-26")),
17    Company: "Mega Corp",
18    Customertitleid: 12,
19    Email: "developers@ticketmatic.com",
20    Firstname: "John",
21    Languagecode: "NL",
22    Lastname: "Doe",
23    Middlename: "K",
24    Optins: []*ticketmatic.ContactOptIn{
25        &ticketmatic.ContactOptIn{
26            Id: 29323,
27            Info: &ticketmatic.ContactOptInInfo{
28                Method: "boxoffice",
29                Remarks: "The customer accepted the terms.",
30            },
31            Optinid: 827,
32            Status: 7602,
33        },
34    },
35    Organizationfunction: "Director of ticketing",
36    Phonenumbers: []*ticketmatic.Phonenumber{
37        &ticketmatic.Phonenumber{
38            Id: 123,
39            Typeid: 3,
40            Customerid: 9364924,
41            Number: "+3216881940",
42            Type: "Home",
43        },
44    },
45    Relationtypes: []int64{
46        1,
47        2,
48    },
49    Sex: "M",
50    Status: "incomplete",
51    Subscribed: false,
52    Vatnumber: "BE123456789",
53    Isdeleted: false,
54    Createdts: ticketmatic.NewTime(ticketmatic.MustParseTime("2014-09-26 15:24:36")),
55    Lastupdatets: ticketmatic.NewTime(ticketmatic.MustParseTime("2014-09-26 15:24:36")),
56}

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    "birthdate": "1986-09-26",
20    "company": "Mega Corp",
21    "customertitleid": 12,
22    "email": "developers@ticketmatic.com",
23    "firstname": "John",
24    "languagecode": "NL",
25    "lastname": "Doe",
26    "middlename": "K",
27    "optins": [
28        {
29            "id": 29323,
30            "info": {
31                "method": "boxoffice",
32                "remarks": "The customer accepted the terms."
33            },
34            "optinid": 827,
35            "status": 7602
36        }
37    ],
38    "organizationfunction": "Director of ticketing",
39    "phonenumbers": [
40        {
41            "id": 123,
42            "typeid": 3,
43            "customerid": 9364924,
44            "number": "+3216881940",
45            "type": "Home"
46        }
47    ],
48    "relationtypes": [ 1, 2 ],
49    "sex": "M",
50    "status": "incomplete",
51    "subscribed": false,
52    "vatnumber": "BE123456789",
53    "isdeleted": false,
54    "createdts": "2014-09-26 15:24:36",
55    "lastupdatets": "2014-09-26 15:24:36"
56}

Parameters

FieldDescription
email
        </td>
        <td class="description">
            <p>Contact e-mail address</p> 
            <strong>Example value:</strong><code>&#34;example@ticketmatic.com&#34;</code>
        </td>
    </tr>
</tbody>

Type reference: ContactGetQuery

Result fields

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" } ]
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"
languagecode
string

Language (ISO 639-1 code)

Example value:"NL"
lastname
string

Last name

Example value:"Doe"
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" } ]
relationtypes
int[]

Relation type IDs

Example value:[ 1, 2 ]
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"

Type reference: Contact