Responders

Auto-responders are agents that send emails to new subscribers at a predefined time after they subscribe.


Renders: [application/json, text/html, application/xml]

Parsers: [application/json, application/x-www-form-urlencoded, multipart/form-data]


Required fields

  • draft
  • list
  • time_to_send

Readonly fields

  • url
  • id
  • mail
  • on_hold
  • sender_name
  • sender_email
  • report

Example auto-responder

{
    "url": "http://gantest.com:8000/v3/responders/18/",
    "id": 18,
    "mail": {
        "url": "http://gantest.com:8000/v3/mails/responders/597/",
        "id": 597,
        "subject": "Updated subject",
        "type": 0
    },
    "on_hold": "2014-06-24T11:26:15Z",
    "time_to_send": {
        "hours": 6,
        "days": 1
    },
    "list": {
        "url": "http://gantest.com:8000/v3/lists/K9rM2ghf6GrNPBIug5nG/",
        "hash": "K9rM2ghf6GrNPBIug5nG",
        "name": "List_34161"
    },
    "sender_name": "John Doe34161",
    "sender_email": "john.doe34161@example.com",
    "report": 18
}

GET /responders/

Returns a list of attributes, like usual we provide next, prev, count and the results

Possible url parameters are:

  • page: <int>

Example:

GET /responders/

HTTP 200 OK
{
    "count": 3,
    "next": null,
    "previous": null,
    "results": [
        {
            "url": "http://gantest.com:8000/v3/responders/18/",
            "id": 18,
            "mail": {
                "url": "http://gantest.com:8000/v3/mails/responders/597/",
                "id": 597,
                "subject": "Updated subject",
                "type": 0
            },
            "on_hold": "2014-06-24T11:26:15Z",
            "time_to_send": {
                "hours": 6,
                "days": 1
            },
            "list": {
                "url": "http://gantest.com:8000/v3/lists/K9rM2ghf6GrNPBIug5nG/",
                "hash": "K9rM2ghf6GrNPBIug5nG",
                "name": "List_34161"
            },
            "sender_name": "John Doe34161",
            "sender_email": "john.doe34161@example.com",
            "report": 18
        },
        ...
    ]
}

POST /responders/

Starts new auto-responder.

Required parameters are:

  • draft - Id of the mail that is going to be send.
  • list - The hash of the list to watch for new subscriptions.
  • senders - The hash of a list. The sender of this list will be used to send the mails.
  • time_to_send - Object with two fields: hours and days. The auto-responder will send the mail to new subscriber when that much time passed after the time of subscription.

Example

POST /responders/
{
    "draft": "587",
    "list": "K9rM2ghf6GrNPBIug5nG",
    "sender": "K9rM2ghf6GrNPBIug5nG",
    "time_to_send": {
        "hours": "4",
        "days": "1"
    }
}

HTTP 200 OK
{
    "url": "http://gantest.com:8000/v3/responders/20/",
    "id": 20,
    "mail": {
        "url": "http://gantest.com:8000/v3/mails/responders/587/",
        "id": 587,
        "subject": "No header and no columns",
        "type": 1
    },
    "on_hold": null,
    "time_to_send": {
        "hours": 4,
        "days": 1
    },
    "list": {
        "url": "http://gantest.com:8000/v3/lists/K9rM2ghf6GrNPBIug5nG/",
        "hash": "K9rM2ghf6GrNPBIug5nG",
        "name": "List_34161"
    },
    "sender_name": "John Doe34161",
    "sender_email": "john.doe34161@example.com",
    "report": 20
}

GET /responders/<id>/

Returns single report.

Example:

GET /responders/18/

HTTP 200 OK
{
    "url": "http://gantest.com:8000/v3/responders/18/",
    "id": 18,
    "mail": {
        "url": "http://gantest.com:8000/v3/mails/responders/597/",
        "id": 597,
        "subject": "Updated subject",
        "type": 0
    },
    "on_hold": "2014-06-24T11:26:15Z",
    "time_to_send": {
        "hours": 6,
        "days": 1
    },
    "list": {
        "url": "http://gantest.com:8000/v3/lists/K9rM2ghf6GrNPBIug5nG/",
        "hash": "K9rM2ghf6GrNPBIug5nG",
        "name": "List_34161"
    },
    "sender_name": "John Doe34161",
    "sender_email": "john.doe34161@example.com",
    "report": 18
}

PUT /responders/<id>/

Used to reschedule an auto-responder.

Note: You can reschedule only paused auto-responders.

Example:

PUT `/responders/<id>/`
{
    "time_to_send": {
    "hours": 6,
    "days": 2
}

HTTP 200 OK
{
    "url": "http://gantest.com:8000/v3/responders/18/",
    "id": 18,
    "mail": {
        "url": "http://gantest.com:8000/v3/mails/responders/597/",
        "id": 597,
        "subject": "Updated subject",
        "type": 0
    },
    "on_hold": "2014-06-24T11:26:15Z",
    "time_to_send": {
        "hours": 6,
        "days": 2
    },
    "list": {
        "url": "http://gantest.com:8000/v3/lists/K9rM2ghf6GrNPBIug5nG/",
        "hash": "K9rM2ghf6GrNPBIug5nG",
        "name": "List_34161"
    },
    "sender_name": "John Doe34161",
    "sender_email": "john.doe34161@example.com",
    "report": 18
}

PATCH /responders/<id>/

Used for partial updates. Since auto-responders only has one updatable field it has the same effect as PUT.


DELETE /responders/<id>/

Deletes the auto-responder.

Example:

DELETE /responders/13/

HTTP 204 NO CONTENT

POST /responders/<id>/delete_related/

Deletes the auto-responder and all associated reports.

Example:

POST /responders/17/delete_related/

HTTP 204 NO CONTENT

POST /responders/<id>/pause/

Pauses the auto-responder. While paused the auto-responder would not send any mails.

Example:

POST /responders/18/pause/

HTTP 204 NO CONTENT

POST /responders/<id>/resume/

Resumes paused auto-responder.

Example:

POST /responders/18/resume/

HTTP 204 NO CONTENT