Create a new dupe detect rule

Content

Resource URL

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

Example

Request

 1use Ticketmatic\Endpoints\Settings\System\Dupedetectrules;
 2
 3$result = Dupedetectrules::create($client, array(
 4    "name" => "name",
 5    "criteria" => array(
 6        array(
 7            "field" => "email",
 8            "matcher" => "exact",
 9        ),
10    ),
11));

Response

 1object(\Ticketmatic\Model\DupeDetectRule) (5) {
 2  ["id"]=>
 3  int(0)
 4  ["name"]=>
 5  string(4) "name"
 6  ["criteria"]=>
 7  array(1) {
 8    [0]=>
 9    object(\Ticketmatic\Model\DupeDetectCriteria) (2) {
10      ["field"]=>
11      string(5) "email"
12      ["matcher"]=>
13      string(5) "exact"
14    }
15  }
16  ["createdts"]=>
17  object(\DateTime) (3) {
18    ["date"]=>
19    string(26) "2014-09-26 15:24:36.000000"
20    ["timezone_type"]=>
21    int(3)
22    ["timezone"]=>
23    string(3) "UTC"
24  }
25  ["lastupdatets"]=>
26  object(\DateTime) (3) {
27    ["date"]=>
28    string(26) "2014-09-26 15:24:36.000000"
29    ["timezone_type"]=>
30    int(3)
31    ["timezone"]=>
32    string(3) "UTC"
33  }
34}

Request

 1import (
 2    "github.com/ticketmatic/tm-go/ticketmatic"
 3    "github.com/ticketmatic/tm-go/ticketmatic/settings/system/dupedetectrules"
 4)
 5
 6result, err := dupedetectrules.Create(client, &ticketmatic.DupeDetectRule{
 7    Name: "name",
 8    Criteria: []*ticketmatic.DupeDetectCriteria{
 9        &ticketmatic.DupeDetectCriteria{
10            Field: "email",
11            Matcher: "exact",
12        },
13    },
14})

Response

 1result := &ticketmatic.DupeDetectRule{
 2    Id: 123,
 3    Name: "name",
 4    Criteria: []*ticketmatic.DupeDetectCriteria{
 5        &ticketmatic.DupeDetectCriteria{
 6            Field: "email",
 7            Matcher: "exact",
 8        },
 9    },
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}

Request

 1POST /api/1/{accountname}/settings/system/dupedetectrules HTTP/1.1
 2Content-Type: application/json
 3
 4{
 5    "name": "name",
 6    "criteria": [
 7        {
 8            "field": "email",
 9            "matcher": "exact"
10        }
11    ]
12}

Response

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

Request body fields

FieldDescription
name
string 
(required)

Rule name

Example value:"name"
criteria
DupeDetectCriteria[] 
(required)

Criteria for matching

Any contact that matches all of these criteria is listed as a match

Example value:[ { "field": "email", "matcher": "exact" } ]

Type reference: DupeDetectRule

Result fields

FieldDescription
id
int

Unique ID

Example value:123
name
string

Rule name

Example value:"name"
criteria

Criteria for matching

Any contact that matches all of these criteria is listed as a match

Example value:[ { "field": "email", "matcher": "exact" } ]
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: DupeDetectRule