« Back to Documentation Overview

add_autoresponder

Section: Messages
Version: 1.5.0


Add a time based autoresponder to the campaign at the specific day of cycle.

  • campaign (mandatory) – CAMPAIGN_ID obtained from get_campaigns. Follow-up will be saved in this campaign.
  • from_field (optional) – FROM_FIELD_ID obtained from get_account_from_fields. It represents From header (name and email) in message and will be taken from campaign if not given.
  • reply_to_field (optional) – FROM_FIELD_ID obtained from get_account_from_fields. It represents Reply-To header (email) in message and will not be present if not given.
  • subject (mandatory) – Subject value. All merge-words should be written as GetResponse Dynamic Content syntax. Maximum length is 512 characters.
  • name (optional) – Name value to help distinguish messages. Contacts won't see it.
  • contents (mandatory) – Allowed keys are plain and html, at least one is mandatory. All merge-words should be written as GetResponse Dynamic Content syntax. Maximum length is 524288 characters each.
  • attachments (optional) - Files that will be attached to message. Field data must be encoded using Base64 algorithm. Filed name represents name of file. Field mime represents media type of file.
  • flags (optional) – Enables extra functionality for a message, see message_flags for available values.
  • day_of_cycle – Number of days between the day when a contact subscribed to a campaign and the day when the autoresponder is sent. Must be in the range of 0..10000.


Parameters
stringAPI_KEY
object
stringcampaignCAMPAIGN_ID
stringfrom_fieldFROM_FIELD_ID
stringreply_to_fieldFROM_FIELD_ID
stringsubjectMy autoresponder
stringnameSay hi
objectcontents
stringplainHello there
stringhtml<h1>Hello</h1>there
arrayattachments
object
stringdataWmHFvMOzxYLEhyBnxJnFm2zEhSBqYcW6xYQu==
stringnameorder.txt
stringmimeapplication/txt
object
stringdataQWxhLGtvdA==
stringnamepeople.csv
stringmimeapplication/csv
arrayflags
stringclicktrack
stringopenrate
integerday_of_cycle32
Return Value
stringMESSAGE_IDabc123
integeradded1

Example Request JSON

[
    "API_KEY",
    {
        "campaign": "CAMPAIGN_ID",
        "from_field": "FROM_FIELD_ID",
        "reply_to_field": "FROM_FIELD_ID",
        "subject": "My autoresponder",
        "name": "Say hi",
        "contents": {
            "plain": "Hello there",
            "html": "<h1>Hello<\/h1>there"
        },
        "attachments": [
            {
                "data": "WmHFvMOzxYLEhyBnxJnFm2zEhSBqYcW6xYQu==",
                "name": "order.txt",
                "mime": "application\/txt"
            },
            {
                "data": "QWxhLGtvdA==",
                "name": "people.csv",
                "mime": "application\/csv"
            }
        ],
        "flags": [
            "clicktrack",
            "openrate"
        ],
        "day_of_cycle": 32
    }
]

Example Response JSON

{
    "MESSAGE_ID": "abc123",
    "added": 1
}

Example Error Response JSON

{
    "code": -1,
    "message": "Dynamic content syntax error"
}
Method-specific Errors
Missing campaign
Missing from field
Missing contents
Dynamic content syntax error
API-wide Errors
API key verification failed API key verification failed
API client IP not allowed API client IP not allowed
Invalid params Attribute params must be reference to hash