Get a single opt in
Content
Resource URL
https://apps.ticketmatic.com/api/1/{accountname}/settings/system/optins/{id}
Example
Request
1use Ticketmatic\Endpoints\Settings\System\Optins;
2
3$result = Optins::get($client, $id);
Response
1object(\Ticketmatic\Model\OptIn) (11) {
2 ["id"]=>
3 int(0)
4 ["typeid"]=>
5 int(0)
6 ["name"]=>
7 string(17) "Marketing e-mails"
8 ["availability"]=>
9 array(2) {
10 [0]=>
11 object(\Ticketmatic\Model\OptInAvailability) (1) {
12 ["saleschannelid"]=>
13 int(0)
14 }
15 [1]=>
16 object(\Ticketmatic\Model\OptInAvailability) (1) {
17 ["saleschannelid"]=>
18 int(0)
19 }
20 }
21 ["caption"]=>
22 string(33) "I do not wish to receive e-mails."
23 ["description"]=>
24 string(40) "Receive marketing related communications"
25 ["nocaption"]=>
26 string(10) "No thanks."
27 ["yescaption"]=>
28 string(62) "Yes, I would like to receive marketing related communications."
29 ["isarchived"]=>
30 bool(false)
31 ["createdts"]=>
32 object(\DateTime) (3) {
33 ["date"]=>
34 string(26) "2014-09-26 15:24:36.000000"
35 ["timezone_type"]=>
36 int(3)
37 ["timezone"]=>
38 string(3) "UTC"
39 }
40 ["lastupdatets"]=>
41 object(\DateTime) (3) {
42 ["date"]=>
43 string(26) "2014-09-26 15:24:36.000000"
44 ["timezone_type"]=>
45 int(3)
46 ["timezone"]=>
47 string(3) "UTC"
48 }
49}
Request
1import (
2 "github.com/ticketmatic/tm-go/ticketmatic"
3 "github.com/ticketmatic/tm-go/ticketmatic/settings/system/optins"
4)
5
6result, err := optins.Get(client, id)
Response
1result := &ticketmatic.OptIn{
2 Id: 123,
3 Typeid: 40001,
4 Name: "Marketing e-mails",
5 Availability: []*ticketmatic.OptInAvailability{
6 &ticketmatic.OptInAvailability{
7 Saleschannelid: 1,
8 },
9 &ticketmatic.OptInAvailability{
10 Saleschannelid: 2,
11 },
12 },
13 Caption: "I do not wish to receive e-mails.",
14 Description: "Receive marketing related communications",
15 Nocaption: "No thanks.",
16 Yescaption: "Yes, I would like to receive marketing related communications.",
17 Isarchived: false,
18 Createdts: ticketmatic.NewTime(ticketmatic.MustParseTime("2014-09-26 15:24:36")),
19 Lastupdatets: ticketmatic.NewTime(ticketmatic.MustParseTime("2014-09-26 15:24:36")),
20}
Request
1GET /api/1/{accountname}/settings/system/optins/{id} HTTP/1.1
Response
1HTTP/1.1 200 OK
2Content-Type: application/json
3
4{
5 "id": 123,
6 "typeid": 40001,
7 "name": "Marketing e-mails",
8 "availability": [
9 {
10 "saleschannelid": 1
11 },
12 {
13 "saleschannelid": 2
14 }
15 ],
16 "caption": "I do not wish to receive e-mails.",
17 "description": "Receive marketing related communications",
18 "nocaption": "No thanks.",
19 "yescaption": "Yes, I would like to receive marketing related communications.",
20 "isarchived": false,
21 "createdts": "2014-09-26 15:24:36",
22 "lastupdatets": "2014-09-26 15:24:36"
23}
Result fields
Field | Description |
---|---|
id int | Unique ID Example value:123 |
typeid int | Type of the opt-in. Can be ‘Mandatory’ (40001) or ‘Optional’ (40002) Example value:40001 |
name | Name Example value:"Marketing e-mails" |
availability | Sales channel where this opt-in is available Example value:[ { "saleschannelid": 1 }, { "saleschannelid": 2 } ] |
caption | Caption for the checkbox, needs to be set when typeid is "I do not wish to receive e-mails." |
description | Description Example value:"Receive marketing related communications" |
nocaption | Caption for no radio button, needs to be set when typeid is "No thanks." |
yescaption | Caption for yes radio button, needs to be set when typeid is "Yes, I would like to receive marketing related communications." |
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: OptIn