Get all campaigns
Returns a list of all campaigns.
Endpoint
Section titled “Endpoint”HTTP method: GET
https://api.sender.net/v2/campaigns?limit=10&status=DRAFT
Parameters
Section titled “Parameters”| Parameter | Type | Description |
|---|---|---|
limit | integer | How many records should be returned on each page of the response. |
status | array | Choose the status to filter your campaigns by, from one of these options: [SCHEDULED, SENDING, SENT or DRAFT] |
Request Examples
Section titled “Request Examples”const url = new URL("https://api.sender.net/v2/campaigns?limit=10&status=DRAFT");
let headers = { "Authorization": "Bearer [your-token]", "Content-Type": "application/json", "Accept": "application/json",};
fetch(url, { method: "GET", headers,}).then(response => response.json()).then(data => console.log(data)).catch(error => console.error('Error:', error));$client = new \GuzzleHttp\Client();$response = $client->get( 'https://api.sender.net/v2/campaigns?limit=10&status=DRAFT', [ 'headers' => [ 'Authorization' => 'Bearer [your-token]', 'Content-Type' => 'application/json', 'Accept' => 'application/json', ], ]);
$body = $response->getBody()->getContents();$data = json_decode($body, true);print_r($data);import requestsimport json
url = "https://api.sender.net/v2/campaigns?limit=10&status=DRAFT"
headers = { "Authorization": "Bearer [your-token]", "Content-Type": "application/json", "Accept": "application/json",}
response = requests.request('GET', url, headers=headers)
print(response.json())curl -X GET \-G "https://api.sender.net/v2/campaigns?limit=10&status=DRAFT" \-H "Authorization: Bearer [your-token]" \-H "Content-Type: application/json" \-H "Accept: application/json"Response
Section titled “Response”{ "data": { "id": "ej06yl", "subject": "Scheduled campaign example subject", "language": "en", "recipient_count": 1, "from": "Sender Support", "schedule_time": null, "last_action": "editor", "sent_time": null, "status": "DRAFT", "created": "2021-05-11 10:43:01", "modified": "2021-05-11 10:48:33", "title": "Scheduled campaign example subject", "domain_id": "bDPoxb", "preheader": "Scheduled campaign example preview text", "auto_followup_active": 0, "auto_followup_subject": "Follow up of Scheduled campaign example subject", "auto_followup_delay": null, "editor": "text", "opens": 0, "clicks": 0, "bounces_count": 0, "send_to_all": 0, "html": { "id": "bojGOK", "thumbnail_url": "https://cdn.sender.net/email_images/9918/540045/html_PbMuBzY0fv9T.png?timestamp=1620744202", "has_preview": true, "html_content": "<p style=\"font-size: 14px; font-family: Arial, Helvetica, sans-serif;\">Hello</p>", "html_body": null }, "sent_count": 0, "campaign_groups": [ "b2vAR1" ], "segments": [] }, "links": { "first": "https://api.sender.net/v2/campaigns?page=1", "last": "https://api.sender.net/v2/campaigns?page=2", "prev": null, "next": "https://api.sender.net/v2/campaigns?page=2" }, "meta": { "current_page": 1, "from": 1, "last_page": 2, "links": [ { "url": null, "label": "pagination.previous", "active": false }, { "url": "https://api.sender.net/v2/campaigns?page=1", "label": 1, "active": true }, { "url": "https://api.sender.net/v2/campaigns?page=2", "label": 2, "active": false }, { "url": "https://api.sender.net/v2/campaigns?page=2", "label": "pagination.next", "active": false } ], "path": "https://api.sender.net/v2/campaigns", "per_page": 10, "to": 10, "total": 12 }, "has_more_resources": true}