Syntax
array searchAutoresponders( string api_key, [ array search_criteria, int limit, int offset, string sort_by, string sort_order ] );
Parameters
api_key
(string)The key required to access the API. See Getting Started for more information.
search_criteria
(array - optional)An array of search criteria. See the remarks section below for the list of values which are searchable.
If you do not specify search criteria, all Autoresponders are returned.limit
(int - optional)Maximum number of items to return.
offset
(int - optional)Number of items to skip before beginning to return results. See Using Search Methods for information about using the
offset
parameter with thelimit
parameter to include pagination in your results.sort_by
(string - optional)The name of the value to sort the results by.
sort_order
(string - optional)The order the results are returned in (either ascending or descending). The default is descending. Valid values are:
DESC
- Sort from highest to lowest (default).ASC
- Sort from lowest to highest.
Return Value
Returns an array containing zero or more associative arrays of Autoresponder details. See the remarks section below for the list of values this method returns.
Examples
array('list_id', 'exactly', 123456),
array('event_type', 'exactly', 'subscribe'),
);
// API Call
$api = new Api($url, 'YOURAPIKEY');
$autoresponders = $api->invokeMethod('searchAutoresponders', array($search_criteria));
"id": 1,
"method": "searchAutoresponders",
"params": [
"YOURAPIKEY",
[
[
[
"list_id",
"exactly",
"123456"
],
[
"event_type",
"exactly",
"subscribe"
]
]
]
]
}
"id": 1,
"result": [
{
"id": "123456",
"is_active": "1",
"event_type": "subscribe",
"creator_user_id": "12346",
"creation_time": "1361774995",
"last_modified_time": "1361774995",
"folder_id": "0",
"timezone": "Australia\/Brisbane",
"list_id": "123456",
"creator_name": "Example Name",
"message_id": "123456",
"time_criteria_type": "delay",
"time_criteria_timestamp": "0",
"time_criteria_offset_period": "hour",
"time_criteria_offset_value": "2",
"time_criteria_specific_hour": 0,
"time_criteria_specific_minute": 0
}
],
"error": null
}
Remarks
The following table shows the values that are returned.
Key | Type | Searchable | Description |
---|---|---|---|
id |
int | Yes | ID of the Autoresponder. |
list_id |
int | Yes | The ID of the List containing the Autoresponder. |
folder_id |
int | Yes | The List Folder ID containing the Autoresponder. |
message_id |
int | Yes | The ID of the Message to send in response to the event. |
event_type |
string | Yes | The Contact event which triggers the Autoresponder. Valid values are subscribe , unsubscribe , update_profile and confirm . |
creator_user_id |
int | Yes | The ID of the User who created the Autoresponder. |
creator_name |
string | Yes | The name of the User who created the Autoresponder. |
creation_time |
int | Yes | Timestamp indicating when the Autoresponder was created. |
last_modified_time |
int | Yes | Timestamp indicating when the Account was last modified. |
timezone |
string | Yes | Timezone in tz format (area/location), for example, Australia/Melbourne. See getTimezoneList. |
is_active |
bool | Yes | Value indicating if Autoresponder is active. |
time_criteria_type |
string | No | When to send the Message. Valid values are immediate , delay and specific . |
time_criteria_timestamp |
int | No | Timestamp indicating when to send the Message if time_criteria_type is specific . |
time_criteria_offset_period |
string | No | Offset period when time_criteria_type is delay . Valid values are minute , hour , day , week , month or year . |
time_criteria_offset_value |
int | No | The number of units of the period chosen in time_criteria_offset_period when time_criteria_type is delay . |
time_criteria_specific_hour |
int | No | The specific hour of the day to send the Message if time_criteria_offset_period is a day or longer. |
time_criteria_specific_minute |
int | No | The specific minute of the hour to send the Message if time_criteria_offset_period is a day or longer. |
Error Codes
This method may return the following error code in addition to the standard error codes:
Code | Error | Description |
---|---|---|
311 |
Invalid Search Parameter Format | search_critera is not valid |