GET /api/v1/campaigns
Get all campaigns

Returns all your campaigns.

Supported Formats

json

Success Response:

200 Good Request
                  
[
  {
    id: 1,
    name: "Pass & Email",
    kind: 1,
    last_sent: null,
    list_id: null,
    email_content: "

Email HTML content

", email_object: "Email subject", email_sender: "Email sender name" }, { id: 2, name: "SMS", kind: 4, last_sent: null, list_id: null, sms_content: "Text message", sms_sender: "Text or phone number" } ]

Errors

400 Bad Request
401 Unauthorized

Examples

curl -i https://api.passdock.com/api/v1/campaigns?api_token=75778a65dfdae310a107d2ef0bbd3780

Params

Param name Description
api_token
required

Your Passdock API key


Value: Must be String

GET /api/v1/campaigns/:id
Show a campaign

Returns a campaign

Supported Formats

json

Success Response:

200 Good Request
                  
{
  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

401 Unauthorized
404 Not Found

Examples

curl -i https://api.passdock.com/api/v1/campaigns/1?api_token=75778a65dfdae310a107d2ef0bbd3780

Params

Param name Description
id
required

Campaign ID


Value: Must be Fixnum
api_token
required

Your Passdock API key


Value: Must be String

POST /api/v1/campaigns
Create a Campaign

Create a new campaign.

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

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

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

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

PUT /api/v1/campaigns/:id
Update Campaign

Update a Campaign.

Supported Formats

json

Success Response:

200 Good Request
                  
              

Errors

400 Bad Request
401 Unauthorized

Examples

curl -i -X PUT -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/1?api_token=75778a65dfdae310a107d2ef0bbd3780

Params

Param name Description
api_token
required

Your Passdock API key


Value: Must be String
id
required

Campaign ID


Value: Must be Fixnum
campaign
required

Object that contains List's informations


Value: Must be a Hash
campaign[name]
required

List's name


Value: Must be String
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

DELETE /api/v1/campaigns/:id
Delete List

Delete a Campaign.

Supported Formats

json

Success Response:

200 Deleted

Errors

400 Bad Request
401 Unauthorized
404 Campaign Not Found

Examples

curl -i -X DELETE  https://api.passdock.com/api/v1/campaigns/1?api_token=75778a65dfdae310a107d2ef0bbd3780

Params

Param name Description
id
required

Campaign ID


Value: Must be Fixnum
api_token
required

Your Passdock API key


Value: Must be String

POST /api/v1/campaigns/deliver
Deliver Campaign

Queues campaign for delivery.

Supported Formats

json

Success Response:

200 Good Request
                  
              

Errors

400 Bad Request
401 Unauthorized
417 Not enough credits

Examples

curl -i -X POST  https://api.passdock.com/api/v1/campaigns/1/deliver?api_token=75778a65dfdae310a107d2ef0bbd3780

Params

Param name Description
api_token
required

Your Passdock API key


Value: Must be String
force
optional

If you haven't got enough credits, it will try to deliver the campaign to as many contacts as possible


Value: Must be Boolean

GET /api/v1/campaigns/kinds
Campaign kinds

Returns all available campaign kinds you can use to create a new campaign.

Supported Formats

json

Success Response:

200 Good Request
                  
{
  1: "Pass & Email",
  2: "Pass & SMS",
  3: "Email",
  4: "SMS"
}

              

Errors

400 Bad Request
401 Unauthorized

Examples

curl -i https://api.passdock.com/api/v1/campaigns/kinds?api_token=75778a65dfdae310a107d2ef0bbd3780

Params

Param name Description
api_token
required

Your Passdock API key


Value: Must be String