Create a new campaign.

At the moment it is not possible to create pass campaigns through the API.

Examples

curl -i -H "Content-Type: application/json" -d '{"campaign":{"name":"Work", "kind":3, "email_content": "<p>Test</p>", "email_object": "Subject", "email_sender": "Sender name"}}' https://api.passdock.com/api/v1/campaigns?api_token=75778a65dfdae310a107d2ef0bbd3780

Supported Formats

json

Success Response:

201 Created
              
{
  id: 1,
  name: "Email",
  kind: 3,
  last_sent: null,
  list_id: null,
  email_content: "

Email HTML content

", email_object: "Email subject", email_sender: "Email sender name" }

Errors

400 Bad Request
401 Unauthorized

Params

Param name Description
api_token
required

Your Passdock API key


Value: Must be String
campaign
required

Object that contains List's informations


Value: Must be a Hash
campaign[name]
required

List's name


Value: Must be String
campaign[kind]
required

Campaign kind. One of 3 or 4. At the moment it is not possible to create pass campaigns through the API.


Value: Must be Fixnum
campaign[list_id]
optional

List ID if you want to send the campaign only to a subset of contacts.


Value: Must be String
campaign[email_content]
required

Only for email campaigns: HTML content of the email


Value: Must be String
campaign[email_object]
required

Only for email campaigns: email subject


Value: Must be String
campaign[email_sender]
required

Only for email campaigns: email sender name (not the email from address!)


Value: Must be String
campaign[sms_content]
required

Only for SMS campaigns: SMS text


Value: Must be String
campaign[email_sender]
required

Only for SMS campaigns: either a phone number (which must be previously authorized) or a string


Value: Must be String