List of operations for the resource


Name

URL

Description

List of mailing templates

/mailing/templates

Returns a list of all mailing templates for the logged-in user. Templates are sorted by date added in ascending order.

Creating a mailing

/mailing/create

Sending order to a selected group of respondents

Sending invitations using batch_id

/mailing/batch

Operation to define a mailing. To define a mailing you must add respondents to a patch



Description of response parameters

Name/path

Description

Possible values

id

Survey ID

name

Template title

subject

Mailing subject

content

Message content in the mailing

date_created

Template creation date

id_mailing

ID of the created mailing in the system

receivers

number of respondents who will receive the invitation

footer

possibility to disable the footer with sender information. By default, the footer is disabled


List of mailing templates

URL

(GET) https://app.customerhero.com/api/v2/mailing/templates

Example response

{
  ["total" বিল্ডিং] => string(1) "2"
  ["list"] => array(2) {
    [0] => array(5) {
      ["id"] => int(7)
      ["name"] => string(7) "Test"
      ["subject"] => string(35) "Invitation to complete the survey"
      ["content"] => string(251) "<p>Hello,<br /> <br /> I invite you to complete the survey about ...<br /> Completing the survey should take about ... minutes<br /> <br /> To complete the survey, click the link:<br /> [LINK]<br /> <br /> <br /> <br /> Thank you and best regards</p>"
      ["date_created"] => string(19) "2015-04-24 13:36:00"
    }
    [1] => array(5) {
      ["id"] => int(8)
      ["name"] => string(8) "Test2"
      ["subject"] => string(35) "Invitation to complete the survey"
 <p>test 2<br /> <br /> I invite you to complete the survey about ...<br /> Completing the survey should take about ... minutes<br /> <br /> To complete the survey, click the link:<br /> [LINK]<br /> <br /> <br /> <br /> Thank you and best regards</p>"
      ["date_created"] => string(19) "2015-04-24 13:36:19"
    }
  }
}


Returned errors

None


Creating a mailing


URL

(POST) https://app.customerhero.co/api/v2/mailing/create


POST parameters

Name/path

Description

Possible values

id_survey

Survey ID

id_template

Invitation template ID

date_send

mailing sending date

mode

mailing sending mode

all - all imported respondents

new - only new respondents who have not been invited yet

reminders - sending to people who received the invitation but have not yet completed the survey

selected - selected respondents

respondent_ids

list of respondents to whom the survey must be sent; mandatory with the mode=selected option

footer

possibility to disable the footer with sender information. By default, the footer is disabled

1 - enabled

0 - disabled

Example response

[
   {
      ["id_mailing"] => string(3) "585",
      ["receivers"] => int(0)
   }
]


Returned errors


• 400 Bad request – Invalid date format, invalid status or
invalid security level
• 401 Unauthorized – No access to the template with the given ID
• 403 Forbidden – Exceeded limits of sending invitations on the account
• 404 Not found – Survey with the given ID was not found on the logged-in
user's account
• 500 Internal Server Error – Internal server error


Sending invitations using batch_id

POST

(POST) customerhero.com/api/v2/mailing/batch

Parameters (POST)

Name

Description

batch_id

Batch ID

template_id

ID of the selected invitation template for sending

with_reminder

bool value determining whether a reminder should be sent to respondents who do not complete the survey. Optional parameter. Default value: false.

reminder_template_id

ID of the selected invitation template for sending the reminder. Parameter required if the with_reminder parameter is set to true. How to obtain template_id?

reminder_delay

number of hours after sending when a reminder should be sent to respondents who have not completed the survey. Parameter required if the with_reminder parameter is set to true.


Returned json values:

Name

Description

mailing_id

ID of the created mailing