Get a list of dupe detect rules

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::getlist($client, array(
4    "filter" => "select id from tm.dupedetectrule where name = 'Email'",
5    "lastupdatesince" => "2014-09-26 15:24:36",
6));
7
8// The parameters array is optional, it can be omitted when empty.
9$result = Dupedetectrules::getlist($client);

Response

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

Request

 1import (
 2    "github.com/ticketmatic/tm-go/ticketmatic"
 3    "github.com/ticketmatic/tm-go/ticketmatic/settings/system/dupedetectrules"
 4)
 5
 6result, err := dupedetectrules.Getlist(client, &ticketmatic.DupeDetectRuleQuery{
 7    Filter: "select id from tm.dupedetectrule where name = 'Email'",
 8    Lastupdatesince: ticketmatic.NewTime(ticketmatic.MustParseTime("2014-09-26 15:24:36")),
 9})
10
11// The query object is optional, it can be omitted when empty.
12result, err := dupedetectrules.Getlist(client, nil)

Response

 1result := dupedetectrules.&List{
 2    Data: []*ticketmatic.DupeDetectRule{
 3        &ticketmatic.DupeDetectRule{
 4            Id: 123,
 5            Name: "name",
 6            Criteria: []*ticketmatic.DupeDetectCriteria{
 7                &ticketmatic.DupeDetectCriteria{
 8                    Field: "email",
 9                    Matcher: "exact",
10                },
11            },
12            Createdts: ticketmatic.NewTime(ticketmatic.MustParseTime("2014-09-26 15:24:36")),
13            Lastupdatets: ticketmatic.NewTime(ticketmatic.MustParseTime("2014-09-26 15:24:36")),
14        },
15    },
16}

Request

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

Response

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

Parameters

FieldDescription
filter
        </td>
        <td class="description">
            <p>Filter the returned items by specifying a query on the public datamodel that returns the ids.</p> 
            <strong>Example value:</strong><code>&#34;select id from tm.dupedetectrule where name = &#39;Email&#39;&#34;</code>
        </td>
    </tr><tr>
        <td class="field">
            <div class="name">lastupdatesince</div>
            
        </td>
        <td class="description">
            <p>All items that were updated since this timestamp will be returned. Timestamp should be passed in <code>YYYY-MM-DD hh:mm:ss</code> format.</p> 
            <strong>Example value:</strong><code>&#34;2014-09-26 15:24:36&#34;</code>
        </td>
    </tr>
</tbody>

Type reference: DupeDetectRuleQuery

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
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[]