Batch operations
Content
Resource URL
https://apps.ticketmatic.com/api/1/{accountname}/contacts/batch
Description
Apply batch operations to a set of contacts.
The parameters required are specific to the type of operation.
What will be affected?
The operation will be applied to the contacts with given IDs. The amount of IDs is limited to 1000 per call.
ids: [1, 2, 3]
This will apply the operation to contacts with ID 1
, 2
and 3
.
Batch operations
The following operations are supported:
addrelationtypes
: Adds the specified relation types to the selection of contacts. Theparameters
object should contain anids
field with a set of relation type IDs.removerelationtypes
: Remove the specified relation types from the selection of contacts. Theparameters
object should contain anids
field with a set of relation type IDs.delete
: Deletes the selection of contacts.subscribe
: Subscribes the selected contacts using the mailing tool.unsubscribe
: Unsubscribes the selected contacts using the mailing tool.sendselection
: Send a selection of contacts to the mailing tool. These contacts can then be used to send out a mailing. Theparameters
object can optionally contain aname
field that will be used to identify the selection.update
: Update a specific field for the selection of contacts. See BatchContactParameters for more info.merge
: Merges the selected contacts into a specified contact. Theprimary
parameter should be supplied to indicate which contact gets preference.
Example
Request
1use Ticketmatic\Endpoints\Contacts;
2
3Contacts::batch($client, array(
4 "ids" => array(
5 1,
6 34,
7 29,
8 ),
9 "operation" => "addrelationtypes",
10 "parameters" => array(
11 ),
12));
Response
This operation does not return a response. The status can be checked by looking at the HTTP status code.
Request
1import (
2 "github.com/ticketmatic/tm-go/ticketmatic"
3 "github.com/ticketmatic/tm-go/ticketmatic/contacts"
4)
5
6err := contacts.Batch(client, &ticketmatic.BatchContactOperation{
7 Ids: []int64{
8 1,
9 34,
10 29,
11 },
12 Operation: "addrelationtypes",
13 Parameters: &ticketmatic.BatchContactParameters{
14 },
15})
Response
This operation does not return a response. The status can be checked by looking at the HTTP status code.
Request
1POST /api/1/{accountname}/contacts/batch HTTP/1.1
2Content-Type: application/json
3
4{
5 "ids": [ 1, 34, 29 ],
6 "operation": "addrelationtypes",
7 "parameters": {
8
9 }
10}
Response
This operation does not return a response. The status can be checked by looking at the HTTP status code.
Request body fields
Field | Description |
---|---|
ids int[] | Restrict operation to supplied IDs, if these ids are not specified all contacts are updated. Example value:[ 1, 34, 29 ] |
operation string (required) | Operation to perform, possible values are: "addrelationtypes" |
parameters | Operation-specific parameters
|
Type reference: BatchContactOperation