Get a list of contact titles

Content

Resource URL

https://apps.ticketmatic.com/api/1/{accountname}/settings/system/contacttitles

Example

Request

 1use Ticketmatic\Endpoints\Settings\System\Contacttitles;
 2
 3$result = Contacttitles::getlist($client, array(
 4    "filter" => "SELECT id FROM tm.contacttitle WHERE sex='M'",
 5    "includearchived" => true,
 6    "lastupdatesince" => "2014-09-26 15:24:36",
 7));
 8
 9// The parameters array is optional, it can be omitted when empty.
10$result = Contacttitles::getlist($client);

Response

 1object(Ticketmatic\Endpoints\Settings\System\ContacttitlesList) (1) {
 2  ["data"]=>
 3  array(1) {
 4    [0]=>
 5    object(\Ticketmatic\Model\ContactTitle) (8) {
 6      ["id"]=>
 7      int(0)
 8      ["name"]=>
 9      string(3) "Mr."
10      ["isinternal"]=>
11      bool(false)
12      ["languagecode"]=>
13      string(2) "nl"
14      ["sex"]=>
15      string(1) "M"
16      ["isarchived"]=>
17      bool(false)
18      ["createdts"]=>
19      object(\DateTime) (3) {
20        ["date"]=>
21        string(26) "2014-09-26 15:24:36.000000"
22        ["timezone_type"]=>
23        int(3)
24        ["timezone"]=>
25        string(3) "UTC"
26      }
27      ["lastupdatets"]=>
28      object(\DateTime) (3) {
29        ["date"]=>
30        string(26) "2014-09-26 15:24:36.000000"
31        ["timezone_type"]=>
32        int(3)
33        ["timezone"]=>
34        string(3) "UTC"
35      }
36    }
37  }
38}

Request

 1import (
 2    "github.com/ticketmatic/tm-go/ticketmatic"
 3    "github.com/ticketmatic/tm-go/ticketmatic/settings/system/contacttitles"
 4)
 5
 6result, err := contacttitles.Getlist(client, &ticketmatic.ContactTitleQuery{
 7    Filter: "SELECT id FROM tm.contacttitle WHERE sex='M'",
 8    Includearchived: true,
 9    Lastupdatesince: ticketmatic.NewTime(ticketmatic.MustParseTime("2014-09-26 15:24:36")),
10})
11
12// The query object is optional, it can be omitted when empty.
13result, err := contacttitles.Getlist(client, nil)

Response

 1result := contacttitles.&List{
 2    Data: []*ticketmatic.ContactTitle{
 3        &ticketmatic.ContactTitle{
 4            Id: 123,
 5            Name: "Mr.",
 6            Isinternal: false,
 7            Languagecode: "nl",
 8            Sex: "M",
 9            Isarchived: false,
10            Createdts: ticketmatic.NewTime(ticketmatic.MustParseTime("2014-09-26 15:24:36")),
11            Lastupdatets: ticketmatic.NewTime(ticketmatic.MustParseTime("2014-09-26 15:24:36")),
12        },
13    },
14}

Request

1GET /api/1/{accountname}/settings/system/contacttitles HTTP/1.1

Response

 1HTTP/1.1 200 OK
 2Content-Type: application/json
 3
 4{
 5    "data": [
 6        {
 7            "id": 123,
 8            "name": "Mr.",
 9            "isinternal": false,
10            "languagecode": "nl",
11            "sex": "M",
12            "isarchived": false,
13            "createdts": "2014-09-26 15:24:36",
14            "lastupdatets": "2014-09-26 15:24:36"
15        }
16    ]
17}

Parameters

FieldDescription
filter

Filter the returned items by specifying a query on the public datamodel that returns the ids.

Example value:"SELECT id FROM tm.contacttitle WHERE sex='M'"
includearchived

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

Example value:true
lastupdatesince

All items that were updated since this timestamp will be returned. Timestamp should be passed in YYYY-MM-DD hh:mm:ss format.

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

Type reference: ContactTitleQuery

Result fields

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

FieldDescription
id
int

Unique ID

Example value:123
name
string

Title name

Example value:"Mr."
isinternal
bool

Restricts this title from showing up on the websales pages

languagecode
string

Language for this title

Example value:"nl"
sex
string

Gender associated with this title

Example value:"M"
isarchived
bool

Whether or not this item is archived

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: ContactTitle[]