Table of Contents:
Table of Contents minLevel 2
Intro
Info |
---|
The Mailing API gives you access to all your mailing campaigns in your account. |
Note: Notice that in each API call you must provide the List ID that you are working on, otherwise the default List ID will be used.
Methods Summary
GET /api/mailings/<Campaign ID>
Description
This method fetches a single mailing, including email messages, segments and distribution.
...
Campaign Status Codes
Status | Code |
---|---|
NEW | 60001 |
SCHEDULED | 60002 |
IN_PROGRESS | 60003 |
COMPLETED | 60004 |
ERROR | 60005 |
CANCELLED | 60006 |
DELETED | 60007 |
COMPLETED_WITH_ERRORS | 60008 |
ON_HOLD | 60009 |
STOPPED | 60010 |
GET /api/mailings
Description
This method will retrieve all the campaigns in a given list based on the optional filters detailed below.
...
Code Block |
---|
{ "metadata": { "error": false, "total": "1" }, "payload": [ { "id": "1234567890", "name": "[TEST] Ongage Support test", "schedule_date": "1638229112", "type": "campaign", "split_type": null, "status": "60004", "list_id": "1234567", "status_desc": "Completed", "status_date": "1638229129", "scheduled_by": "23913", "has_quota": "0", "split_subject_content_email_id": null, "created_by": "23913", "favorite": "0", "created": "1638229112", "modified": "1638229724", "deleted": "0", "is_test": "1", "progress": "100", "manager": "Mr. Manager", "targeted": "1", "cannot_resume": "0", "cannot_resume_reason": "", "original_email_message_id": "12345678", "ox_data": null, "sending_start_date": "1638229119", "sending_end_date": "1638229128", "estimated_sending_end_date": "0", "emails_limit": "0", "report": 1, "test": 0, "cancel": 0, "schedule": "delivered", "esps": "SparkPost", "comment": "", "email_id": "12345678", "email_name": "Ongage Support test 34091", "message_type": "email_message", "is_email_designer": "0" } ] } |
POST /api/mailings
Description
This method creates a new mailing campaign. If "schedule_date" is provided (as Unix timestamp), campaign will be scheduled.
...
- 400 - Invalid data in request
403 - Permission error
404 - Campaign not found
POST /api/mailings/<Campaign ID>duplicate
Description
This method is used for duplicating Bulk campaigns. Please note that duplicating A/B Split or Test Campaign is not supported.
...
Code Block |
---|
{ "email_message_id":123456, ///mendatory// "segments":[ ], ///optional/// "segments_excluded":[ ], ///optional/// "add_copy_to_title": true/false, ///optional/// } |
PUT /api/mailings/<Campaign ID>
Description
This method updates an existing mailing campaign. If schedule_date is provided (as Unix timestamp), campaign will be scheduled.
...
- 400 - Invalid data in request
403 - Permission error
404 - Campaign not found
PUT /api/mailings/<Campaign ID>/abort
Description
This method is used to toggle campaign status On Hold / Stopped / In Progress.
...
403 - Permission error
404 - Campaign not found
PUT /api/mailings/<Campaign ID>/cancel
Description
This method is used to cancel/delete an existing mailing campaign.
...
403 - Permission error
404 - Campaign not found
PUT /api/mailings/<Campaign ID>/unschedule
Description
This method is used to Un-schedule a campaign. This will set the campaign status to "New".
...
403 - Permission error
404 - Campaign not found
PUT /api/mailings/<Campaign ID>/revive
Description
This method Revives a canceled/deleted campaign.
Additional Examples
Request Example - Regular campaign request sample with ESP connection/domain distribution
...
Code Block |
---|
{ "name": “example", "email_message": "12345", "keep_segment_sort": true, "segments": ["1233456"], "distribution": { { "esp_connection_id": "122456", "isp_idpercent": "0100", } "percent}, "schedule_date": "100" } }, 11/11/1111 11:11", "emails_limit_active": true, "emails_limit_global_active": true, "emails_limit": "10" } |
...