Get a list of phone number types

Content

Resource URL

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

Example

Request

 1use Ticketmatic\Endpoints\Settings\System\Phonenumbertypes;
 2
 3$result = Phonenumbertypes::getlist($client, array(
 4    "filter" => "SELECT id FROM tm.contactphonenumbertype WHERE name LIKE 'H%'",
 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 = Phonenumbertypes::getlist($client);

Response

 1object(Ticketmatic\Endpoints\Settings\System\PhonenumbertypesList) (1) {
 2  ["data"]=>
 3  array(1) {
 4    [0]=>
 5    object(\Ticketmatic\Model\PhoneNumberType) (5) {
 6      ["id"]=>
 7      int(0)
 8      ["name"]=>
 9      string(4) "Home"
10      ["isarchived"]=>
11      bool(false)
12      ["createdts"]=>
13      object(\DateTime) (3) {
14        ["date"]=>
15        string(26) "2014-09-26 15:24:36.000000"
16        ["timezone_type"]=>
17        int(3)
18        ["timezone"]=>
19        string(3) "UTC"
20      }
21      ["lastupdatets"]=>
22      object(\DateTime) (3) {
23        ["date"]=>
24        string(26) "2014-09-26 15:24:36.000000"
25        ["timezone_type"]=>
26        int(3)
27        ["timezone"]=>
28        string(3) "UTC"
29      }
30    }
31  }
32}

Request

 1import (
 2    "github.com/ticketmatic/tm-go/ticketmatic"
 3    "github.com/ticketmatic/tm-go/ticketmatic/settings/system/phonenumbertypes"
 4)
 5
 6result, err := phonenumbertypes.Getlist(client, &ticketmatic.PhoneNumberTypeQuery{
 7    Filter: "SELECT id FROM tm.contactphonenumbertype WHERE name LIKE 'H%'",
 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 := phonenumbertypes.Getlist(client, nil)

Response

 1result := phonenumbertypes.&List{
 2    Data: []*ticketmatic.PhoneNumberType{
 3        &ticketmatic.PhoneNumberType{
 4            Id: 123,
 5            Name: "Home",
 6            Isarchived: false,
 7            Createdts: ticketmatic.NewTime(ticketmatic.MustParseTime("2014-09-26 15:24:36")),
 8            Lastupdatets: ticketmatic.NewTime(ticketmatic.MustParseTime("2014-09-26 15:24:36")),
 9        },
10    },
11}

Request

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

Response

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

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.contactphonenumbertype WHERE name LIKE 'H%'"
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: PhoneNumberTypeQuery

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

Name of the phone number type

Example value:"Home"
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: PhoneNumberType[]