editAutoresponder

Edits an Autoresponder.

editAutoresponder

Edits an Autoresponder.

Top ↑

Syntax

int editAutoresponder( string api_key, array autoresponder_details );

Parameters

api_key (string)

The key required to access the API. See Getting Started for more information.

autoresponder_details (array)

An associative array of Autoresponder details to be edited. See remarks below for a description of the values in the autoresponder_details array.

Return Value

Returns the ID of the modified Autoresponder on success.

Examples

$autoresponder_details = array(
    'id'                          => 123456,    // See searchAutoresponders()
    'time_criteria_type'          => 'delay',
    'time_criteria_offset_value'  => 2,
    'time_criteria_offset_period' => 'hour'
);

$api = new Api($url, 'YOURAPIKEY');
$autoresponder = $api->invokeMethod('editAutoresponder', $autoresponder_details);
{
    "id": 1,
    "method": "editAutoresponder",
    "params": [
        "YOURAPIKEY",
        {
            "id": 123456,
            "time_criteria_type": "delay",
            "time_criteria_offset_value": 2,
            "time_criteria_offset_period": "hour"
        }
    ]
}
{
    "id": 1,
    "result": 123456,
    "error": null
}

Remarks

The following table shows the structure of the autoresponder_details array.

Key Type Mandatory Description
id int Yes ID of the Autoresponder.
list_id int No The ID of the List containing the Autoresponder.
message_id int No The ID of the Message to send in response to the event.
event_type string No The Contact event which triggers the Autoresponder. Valid values are subscribe, unsubscribe, update_profile and confirm. See addAutoresponder for more information.
folder_id int No The List Folder ID containing the Autoresponder.
timezone string No Timezone in tz format (area/location), for example, Australia/Melbourne. See getTimezoneList.
is_active bool No Value indicating if Autoresponder is active.
time_criteria_type string No When to send the Message. Valid values are immediate, delay and specific. See addAutoresponder for more information.
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. See addAutoresponder for more information.
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 codes in addition to the standard error codes:

Code Error Description
310 Invalid timezone timezone format is not recognized.
310 Invalid event_type event_type is specified as something other than subscribe, unsubscribe, update_profile or confirm.
310 Invalid time_criteria_offset_period time_criteria_type is set to delay and time_criteria_offset_period is not set, or is set to something other than minute, hour, day, week, month or year
310 time_criteria_offset_period equal to or greater than a day requires a valid time_criteria_specific_hour time_criteria_type is delay and time_criteria_offset_period is day, week, month or year, and time_criteria_specific_hour is not set
310 time_criteria_offset_period equal to or greater than a day requires a valid time_criteria_specific_minute time_criteria_type is delay and time_criteria_offset_period is day, week, month or year, and time_criteria_specific_minute is not set
310 Invalid time_criteria_type time_criteria_type is set to something other than immediate, delay or specific

See Also