List campaigns


https://dash.stannp.com/api/v1/campaigns/list
Request
$ curl https://dash.stannp.com/api/v1/campaigns/list?api_key={API_KEY}
Toggle Response
{
   "success":true,
   "data":[
      {
         "id":"222",
         "account_id":"9",
         "name":"a5 test",
         "template_id":"0",
         "type":"a5-postcard",
         "trigger_date":null,
         "send_date":null,
         "trigger_offset":null,
         "created":"2015-04-26T10:40:00Z",
         "updated":"2015-04-26T10:40:00Z",
         "status":"draft",
         "recipients_group":"0",
         "recipients_filter":"",
         "recipients_validated":"valid",
         "recipients":"0",
         "recipients_not_valid":"0",
         "dispatched":"0",
         "cost":"0.00",
         "rate":"0",
         "voucher_code":"",
         "image":null,
         "message":null
      },
      {
         "id":"221",
         "account_id":"9",
         "name":"April Campaign",
         "template_id":"195",
         "type":"a6-postcard",
         "trigger_date":null,
         "send_date":null,
         "trigger_offset":null,
         "created":"2015-04-26T10:15:40Z",
         "updated":"2015-04-26T10:15:40Z",
         "status":"draft",
         "recipients_group":"0",
         "recipients_filter":"",
         "recipients_validated":"valid",
         "recipients":"0",
         "recipients_not_valid":"0",
         "dispatched":"0",
         "cost":"0.00",
         "rate":"0",
         "voucher_code":"",
         "image":"https://business.stannp.com/api/v1/uploads/9/image-1430044053.jpg",
         "message":""
      }
   ]
}

Get a single campaign


https://dash.stannp.com/api/v1/campaigns/get/:id
Request
$ curl https://dash.stannp.com/api/v1/campaigns/get/1234?api_key={API_KEY}
Toggle Response
{
   "success":true,
   "data":{
      "id":"126",
      "account_id":"9",
      "name":"Ashley Wilde Blinds",
      "template_id":"111",
      "type":"a6-postcard",
      "trigger_date":null,
      "send_date":null,
      "trigger_offset":null,
      "created":"2015-03-17 11:04:19",
      "updated":"2015-03-20 10:57:05",
      "status":"approved",
      "recipients_group":"15",
      "recipients_filter":"",
      "recipients_validated":"valid",
      "recipients":"232",
      "recipients_not_valid":"0",
      "dispatched":"0",
      "cost":"0.00",
      "rate":"0",
      "voucher_code":"",
      "template_name":"",
      "image":"https://business.stannp.com/api/v1/uploads/9/image-1426590259.jpg",
      "message":"Ashley Wilde Group announce our new wood venetian blinds\n\nAvailable in a choice of 15 colours and slats 25mm 35mm or 50mm. \n\nCall our sales office on 01707 635 201 for more info!!\n\nOr visit.\nwww.ashleywildegroup.co.uk",
      "branding":"https://business.stannp.com/api/v1/uploads/9/branding-1426590259.jpg",
      "size":"A6",
      "back_image":null,
      "font":"dejaVu Sans",
      "font_size":"12",
      "font_colour":"0,0,0",
      "padding_front":"6",
      "padding_back":"0",
      "address_format":null,
      "return_address":"1"
   }
}

Create a new campaign


https://dash.stannp.com/api/v1/campaigns/create

Parameters

name string Name your campaign for reference.
type a6-postcard | a5-postcard | letter The type of campaign this will be.
template_id int A template ID to make a copy of. If left out or set to "0" then a blank template of the correct format will be used.
group_id int A group id
what_recipients all | valid | not_valid | int What recipients do you want this campaign to go to?
"all" is every recipient in the group
"valid" send to only UK validated addresses
"not_valid" send to only UK non validated addresses
"int" send to only international addresses
code string If you have a voucher code.
Request
$ curl https://dash.stannp.com/api/v1/campaigns/draft?api_key={API_KEY} \
-d "name=My Campaign" \
-d "type=a6-postcard" 
Response
{
   "success":true,
   "data":{
      "id":"266"
   }
}

Approve a campaign

When approving a campaign you take full responsibility for any spelling mistakes or design flaws. Once approved we will select all recipient data at this point and future changes to the same data will not apply to this campaign. This campaign will then be locked so you will be unable to makes changes to the design or recipient selection.
https://dash.stannp.com/api/v1/campaigns/approve

Parameters

id int The id of the campaign to delete
Request
$ curl https://dash.stannp.com/api/v1/campaigns/approve?api_key={API_KEY}
-d "id=123" \
Response
{
   "success":true,
   "data":{}
}

Book a campaign

When booking your campaign payment will be taken from your balance.
https://dash.stannp.com/api/v1/campaigns/book

Parameters

id int The id of the campaign to delete
send_date string The dispatch date of the campaign. Must be in a YYYY-MM-DD format. eg: 2018-12-18
Request
$ curl https://dash.stannp.com/api/v1/campaigns/book?api_key={API_KEY}
-d "id=123" \
-d "send_date=2018-12-18"
Response
{
   "success":true,
   "data":{}
}

Delete a campaign


https://dash.stannp.com/api/v1/campaigns/delete

Parameters

id int The id of the campaign to delete
Note that this will permanently delete the campaign.
Request
$ curl https://dash.stannp.com/api/v1/campaigns/delete?api_key={API_KEY}
-d "id=123" \
Response
{
   "success":true,
   "data":{}
}