Create a new custom field value

Content

Resource URL

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

Example

Request

1use Ticketmatic\Endpoints\Settings\System\Customfieldvalues;
2
3$result = Customfieldvalues::create($client, array(
4    "typeid" => 10000,
5    "caption" => "Rock",
6    "sortorder" => 0,
7));

Response

 1object(\Ticketmatic\Model\CustomFieldValue) (7) {
 2  ["id"]=>
 3  int(0)
 4  ["typeid"]=>
 5  int(0)
 6  ["caption"]=>
 7  string(4) "Rock"
 8  ["sortorder"]=>
 9  int(0)
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

Request

 1import (
 2    "github.com/ticketmatic/tm-go/ticketmatic"
 3    "github.com/ticketmatic/tm-go/ticketmatic/settings/system/customfieldvalues"
 4)
 5
 6result, err := customfieldvalues.Create(client, &ticketmatic.CustomFieldValue{
 7    Typeid: 10000,
 8    Caption: "Rock",
 9    Sortorder: 0,
10})

Response

1result := &ticketmatic.CustomFieldValue{
2    Id: 123,
3    Typeid: 10000,
4    Caption: "Rock",
5    Sortorder: 0,
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}

Request

1POST /api/1/{accountname}/settings/system/customfieldvalues HTTP/1.1
2Content-Type: application/json
3
4{
5    "typeid": 10000,
6    "caption": "Rock",
7    "sortorder": 0
8}

Response

 1HTTP/1.1 200 OK
 2Content-Type: application/json
 3
 4{
 5    "id": 123,
 6    "typeid": 10000,
 7    "caption": "Rock",
 8    "sortorder": 0,
 9    "isarchived": false,
10    "createdts": "2014-09-26 15:24:36",
11    "lastupdatets": "2014-09-26 15:24:36"
12}

Request body fields

FieldDescription
typeid
int 
(required)

Type ID

Example value:10000
caption
mlstring 
(required)

Human-readable name for the value

Example value:"Rock"
sortorder
int 
(required)

Indicated the manual sort order

        </td>
    </tr>
</tbody>

Type reference: CustomFieldValue

Result fields

FieldDescription
id
int

Unique ID

Example value:123
typeid
int

Type ID

Example value:10000
caption

Human-readable name for the value

Example value:"Rock"
sortorder
int

Indicated the manual sort order

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