Get a list of product categories

Content

Resource URL

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

Example

Request

 1use Ticketmatic\Endpoints\Settings\Productcategories;
 2
 3$result = Productcategories::getlist($client, array(
 4    "filter" => "SELECT id FROM tm.productcategory WHERE nameen LIKE \"%e\"",
 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 = Productcategories::getlist($client);

Response

 1object(Ticketmatic\Endpoints\Settings\ProductcategoriesList) (1) {
 2  ["data"]=>
 3  array(1) {
 4    [0]=>
 5    object(\Ticketmatic\Model\ProductCategory) (8) {
 6      ["id"]=>
 7      int(0)
 8      ["name"]=>
 9      string(5) "serie"
10      ["contactname"]=>
11      string(6) "holder"
12      ["contactnameplural"]=>
13      string(7) "holders"
14      ["nameplural"]=>
15      string(6) "series"
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/productcategories"
 4)
 5
 6result, err := productcategories.Getlist(client, &ticketmatic.ProductCategoryQuery{
 7    Filter: "SELECT id FROM tm.productcategory WHERE nameen LIKE \"%e\"",
 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 := productcategories.Getlist(client, nil)

Response

 1result := productcategories.&List{
 2    Data: []*ticketmatic.ProductCategory{
 3        &ticketmatic.ProductCategory{
 4            Id: 123,
 5            Name: "serie",
 6            Contactname: "holder",
 7            Contactnameplural: "holders",
 8            Nameplural: "series",
 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/productcategories HTTP/1.1

Response

 1HTTP/1.1 200 OK
 2Content-Type: application/json
 3
 4{
 5    "data": [
 6        {
 7            "id": 123,
 8            "name": "serie",
 9            "contactname": "holder",
10            "contactnameplural": "holders",
11            "nameplural": "series",
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
string

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

Example value:"SELECT id FROM tm.productcategory WHERE nameen LIKE "%e""
includearchived
bool

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

Example value:true
lastupdatesince
timestamp

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: ProductCategoryQuery

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 for the product category

Example value:"serie"
contactname

Name for the holder/owner of this product

Example value:"holder"
contactnameplural

Name for the holder/owner of this product in plural

Example value:"holders"
nameplural

Name for the product category in plural

Example value:"series"
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: ProductCategory[]