Get campaign details
Get a specific campaign.
Endpoint
Section titled “Endpoint”HTTP method: GET
https://api.sender.net/v2/campaigns/{id}
Parameters
Section titled “Parameters”| Parameter | Type | Description |
|---|---|---|
id | string required | Campaign ID |
Request Examples
Section titled “Request Examples”const url = new URL("https://api.sender.net/v2/campaigns/{id}");
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/{id}', [ '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/{id}"
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/{id}" \-H "Authorization: Bearer [your-token]" \-H "Content-Type: application/json" \-H "Accept: application/json"Response
Section titled “Response”{ "data": { "id": "e1GpjV", "subject": "Example campaign", "language": "eng", "recipient_count": 1, "from": "Sender Support", "schedule_time": null, "last_action": "step4", "sent_time": "2021-05-13 17:08:02", "status": "SENT", "created": "2021-05-13 17:07:07", "modified": "2021-05-13 17:08:02", "title": "Example campaign", "domain_id": "bDPoxb", "preheader": "Example campaign", "auto_followup_active": 0, "auto_followup_subject": "Follow up of test", "auto_followup_delay": null, "editor": "html", "opens": 1, "clicks": 0, "bounces_count": 0, "send_to_all": 0, "html": { "id": "eZzAG6", "thumbnail_url": "https://cdn.sender.net/email_images/9918/542151/html_0QtlS2YgaF56.png?timestamp=1620939553", "has_preview": true, "html_content": "<!DOCTYPE html>\n<html xmlns=\"http://www.w3.org/1999/xhtml\">\n <head>\n <meta http-equiv=\"Content-Type\" content=\"text/html; charset=UTF-8\" />\n <title></title>\n <style>\n\n </style>\n </head>\n <body>\n <table border=\"0\" cellpadding=\"0\" cellspacing=\"0\" height=\"100%\" width=\"100%\">\n <tr>\n <td align=\"center\" valign=\"top\">\n <table border=\"0\" cellpadding=\"20\" cellspacing=\"0\" width=\"100%\">\n <tr>\n <td align=\"center\" valign=\"top\" style=\"color: #000000; font-family: Arial, Helvetica, sans-serif; font-size: 12px;\">\n <p>Content</p>\n <a href=\"www.sender.net\">Email marketing</a>\n <p>\n <a href=\"{$unsubscribe_link}\" style=\"color: #000000; font-family: Arial, Helvetica, sans-serif; font-size: 12px; text-decoration: underline;\">Unsubscribe</a>\n </p>\n </td>\n </tr>\n </table>\n </td>\n </tr>\n </table>\n </body>\n</html>", "html_body": "<!DOCTYPE html><html xmlns=\"http://www.w3.org/1999/xhtml\"> <head> <meta http-equiv=\"Content-Type\" content=\"text/html; charset=UTF-8\"> <title></title> <style> </style> </head> <body><img src=\"https://d2ag3jdu89hmr4.cloudfront.net/email_open/[EMAIL_ID]\" width=\"1\" height=\"1\" border=\"0\" alt=\"\" style=\"height:1px !important;width:1px !important;border-width:0 !important;margin-top:0 !important;margin-bottom:0 !important;margin-right:0 !important;margin-left:0 !important;padding-top:0 !important;padding-bottom:0 !important;padding-right:0 !important;padding-left:0 !important;outline-style:none;text-decoration:none;display:block;\"> <table border=\"0\" cellpadding=\"0\" cellspacing=\"0\" height=\"100%\" width=\"100%\"> <tr> <td align=\"center\" valign=\"top\"> <table border=\"0\" cellpadding=\"20\" cellspacing=\"0\" width=\"100%\"> <tr> <td align=\"center\" valign=\"top\" style=\"color: #000000; font-family: Arial, Helvetica, sans-serif; font-size: 12px;\"> <p>Content</p> <a href=\"https://d2ag3jdu89hmr4.cloudfront.net/link_click/%5BEMAIL_ID%5D/7c5a63acdb83ea87ce7eb54082b2f575\" rel=\"7c5a63acdb83ea87ce7eb54082b2f575\">Email marketing</a> <p> <a href=\"https://d2ag3jdu89hmr4.cloudfront.net/unsubscribe/[EMAIL_ID]\" style=\"color: #000000; font-family: Arial, Helvetica, sans-serif; font-size: 12px; text-decoration: underline;\">Unsubscribe</a> </p> </td> </tr> </table> </td> </tr> </table> <table cellpadding=\"0\" cellspacing=\"0\" border=\"0\" align=\"center\" class=\"wrapper\" style=\"-ms-text-size-adjust: 100%; -webkit-text-size-adjust: 100%; mso-table-lspace: 0pt; mso-table-rspace: 0pt; border-collapse: collapse !important;\"><tbody><tr><td valign=\"middle\" width=\"185\" height=\"32\" style=\"padding:10px\"><a href=\"http://sender.net?utm_source=sender_user&utm_campaign=9918\"><img width=\"185\" height=\"32\" src=\"https://stats.sender.net/img/free_plan_logo.png\" alt=\"Powered by Sender.net\" style=\"width: 185px;height: 32px;display: block;\"></a></td></tr></tbody></table></body></html>" }, "sent_count": 1, "campaign_groups": [ "dN9n8z" ], "segments": [] }}