up

Batch

Actions related to sent or scheduled batches. A batch is basically a 'segment' that was sent or is about to be sent.

Get a batch

A campaign generates a batch every time it is sent. A batch is needed to get statistics for a specific send.

HTTP method: GET
http://api.sendcastle.com/v1/batch/[123]
http://api.sendcastle.com/v1/batch/[all]
cURL example
curl http://api.sendcastle.com/v1/batch/[123] \
	-H "Authorization: Bearer YOUR_API_SECRET_HERE" \
-H "Content-Type: application/json"
Example of result
{
	"responseId":"50cef8fcaxxxx",
	"version":1,
	"success":true,
	"data":{
		"emt_batches":{
		"id":"1",
		"xxx"
	}
}
Other constraints:
  • Identifier can be an integer or 'all'
  • No additional parameters required, unless stated elsewhere
  • No extra security requirements
  • Requires read access
Create a batch

A campaign generates a batch every time it is sent. A batch is needed to get statistics for a specific send.

HTTP method: PUT
http://api.sendcastle.com/v1/batch/[123]
cURL example
curl http://api.sendcastle.com/v1/batch/[123] \
	-H "Authorization: Bearer YOUR_API_SECRET_HERE" \
-H "Content-Type: application/json" \ -X PUT
Example of result
{
	"responseId":"50cef8fcaxxxx",
	"version":1,
	"success":true,
	"data":{
		"id":"1"
	}
}
Other constraints:
  • Identifier should be an integer
  • No additional parameters required, unless stated elsewhere
  • No extra security requirements
  • Requires create access
  • Requires administrator access
Change a batch

A campaign generates a batch every time it is sent. A batch is needed to get statistics for a specific send.

HTTP method: POST
http://api.sendcastle.com/v1/batch/[123]
cURL example
curl http://api.sendcastle.com/v1/batch/[123] \
	-H "Authorization: Bearer YOUR_API_SECRET_HERE" \
-H "Content-Type: application/json" \ -X POST
Example of result
{
	"responseId":"50cef8fcaxxxx",
	"version":1,
	"success":true,
	"data":true
}
Other constraints:
  • Identifier should be an integer
  • No additional parameters required, unless stated elsewhere
  • No extra security requirements
  • Requires write access
  • VC_VRO
Delete a batch

A campaign generates a batch every time it is sent. A batch is needed to get statistics for a specific send.

HTTP method: DELETE
http://api.sendcastle.com/v1/batch/[123]
cURL example
curl http://api.sendcastle.com/v1/batch/[123] \
	-H "Authorization: Bearer YOUR_API_SECRET_HERE" \
-H "Content-Type: application/json" \ -X DELETE
Example of result
{
	"responseId":"50cef8fcaxxxx",
	"version":1,
	"success":true,
	"data":true
}
Other constraints:
  • Identifier should be an integer
  • No additional parameters required, unless stated elsewhere
  • No extra security requirements
  • Requires delete access
  • Requires administrator access
Get all batches related to campaign

Gets all batches that has been sent using a specific campaign.

HTTP method: GET
http://api.sendcastle.com/v1/batch/[xx]/campaign/[yy]
cURL example
curl http://api.sendcastle.com/v1/batch/[xx]/campaign/[yy] \
	-H "Authorization: Bearer YOUR_API_SECRET_HERE" \
-H "Content-Type: application/json"
Example of result
{
	"responseId":"50cef8fcaxxxx",
	"version":1,
	"success":true,
	"data":{
		"emt_??":{
		"id":"1",
		"xxx"
	}
}
Other constraints:
  • Identifier should be an integer
  • No additional parameters required, unless stated elsewhere
  • No extra security requirements
  • Requires read access
Get rendered batch

Does NOT return JSON; this returns a fully rendered version of the mail for batch.

HTTP method: GET
http://api.sendcastle.com/v1/batch/[xx]/render/[yy]
cURL example
curl http://api.sendcastle.com/v1/batch/[xx]/render/[yy] \
	-H "Authorization: Bearer YOUR_API_SECRET_HERE" \
-H "Content-Type: application/json"
Example of result
{
	"responseId":"50cef8fcaxxxx",
	"version":1,
	"success":true,
	"data":{
		"n/a":{
		"id":"1",
		"xxx"
	}
}
Other constraints:
  • No additional parameters required, unless stated elsewhere
  • No extra security requirements
  • Requires read access
Get batch contents

Get all message parts of a specified batch (a batch is a sent campaign).

HTTP method: GET
http://api.sendcastle.com/v1/batch/[xx]/content/[yy]
cURL example
curl http://api.sendcastle.com/v1/batch/[xx]/content/[yy] \
	-H "Authorization: Bearer YOUR_API_SECRET_HERE" \
-H "Content-Type: application/json"
Example of result
{
  "responseId":123456789,
  "version":1,
  "success":true,
  "data":{
    "emt_batches":{
      "__content__":{
        "31344-31291":{
          "from":"SendCastle <info@sendcastle.com>",
          "subject":"API Open for public consumption",
          "body":"<html>...<\/html>",
          "path":"31344-31291"
        },
        "31344-31184":{
          "from":"SendCastle <info@sendcastle.com>",
          "subject":"API Open for public consumption",
          "body":"<html>...different...<\/html>",
          "path":"31344-31184"
        }
      }
    }
  }
}
Other constraints:
  • No additional parameters required, unless stated elsewhere
  • No extra security requirements
  • Requires read access