Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

Table of Contents:

Table of Contents
minLevel2

Intro

Info
The Transactional API gives you access to all your transactional mailing campaigns in your account.

(info) 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/transactional

Description 

This method fetches a collection of transactional campaigns.

...

Optional int

limit

Optional int

POST /api/transactional

Description 

This method creates a new transactional campaign.

...

Code Block
// Request example
{ "name": "My Transactional", "description": "My first transactional campaign", "message_type": "email" }

Response

The response will include a newly created transactional campaign array of fields.

PUT /api/transactional/<Transactional Campaign ID>

Description 

This method updates an existing transactional campaign.

...

Code Block
// Request example
{ "name": "My Transactional", "description": "My first transactional campaign" }

POST /api/transactional/send

Description 

This method is used to send a transactional message.

(info) Note: Not all ESPs/SMTP relays support transactional calls.

...

Required array of strings

Recipients for delivery. This must be array of emails.Note that for transactional SMS, array of emails is also required.. This must be array of emails.

Note: In the case of SMS Transactional campaigns; you can also use a mobile number (in the format suggested by SMS vendor you are using). We recommend using this for testing purposes only; because Open/clicks will not register when a mobile number is used as a recipient.  

campaign_id

Optional number

...

POST URL: https://api.ongage.net/<list_idid>/api/transactional/send

Code Block
{
  "message_id": 168,
  "recipients": [ "email@email.com", "..." ]
}

...

Code Block
{
     "message_id": 168,
     "campaign_id": 213,
     "recipients": [ "email@email.com", "..." ],
     "check_status": true,
     "check_suppression": true
}

POST /api/transactional/send_embed_content

Description 

This method is used to send a transactional message with embedded content (without message ID).

...

Recipients for delivery. This must be an array of emails.Note that for transactional SMS, array of emails is also requiredof emails.

Note: In the case of SMS Transactional campaigns; you can also use a mobile number (in the format suggested by SMS vendor you are using). We recommend using this for testing purposes only; because Open/clicks will not register when a mobile number is used as a recipient.

campaign_id

Optional number

...

Code Block
{
  "message": {
    "subject": "Hello!",
       "content_html" :"<html><body><p>This is my content</p></body></html>",
       "addresses": {
            "from_name": "John Doe",
            "from_address": "john@doe.com",
            "reply_address": "john@doe.com"
        }
     },
  "campaign_id": 213,
  "recipients": [ "email@email.com", "..." ],
  "sending_connection_id": 1234
}

POST /api/notify_transactions

Warning

(warning) This method is being deprecated, but we're continuing to support it for the long run.
At your convenience please upgrade to: POST /api/transactional/send or POST /api/transactional/send_embed_content method mentioned above.

...

Recipients for delivery. This must be array of emails.

Note that for transactional SMS, array of emails is also required: In the case of SMS Transactional campaigns; you can also use a mobile number (in the format suggested by SMS vendor you are using). We recommend using this for testing purposes only; because Open/clicks will not register when a mobile number is used as a recipient.

mailing_id

Optional number

...

  • 403 - Permission error
  • 404 - Email/Campaign not found

DELETE /API/transactional/<Transactional Campaign ID>

Description

This method deletes a transactional campaign.

Additional Examples

Request Example - Transactional Send - Using specific transactional campaign and specific connection

...

POST URL: https://api.ongage.net/<list_id>/api/transactional_/send

Code Block
// Email with the following HTML
<p>
   Hello {{first_name}} and congratulations on your birthday, you are {{age}} years old!
</p>

...

Request Example - Transactional Send - Using SMS message content

POST URL: https://api.ongage.net/<list_id>/api/transactional_/send

Code Block
{
  "message_id":45678,
  "campaign_id": 213,
  "recipients": [ "email@email.com", "..." ],
  "sending_connection_id": 556677,
  "disable_unsubscribe": true
}

...

Code Block
{
  "mailing_id": 213,
  "recipients": [ "email@email.com", "..." ],  // You can use Mobile number with Country code (+1XXXXXXXXXX) as well in place of email address.
  "email_message": {
   "content_text": "SMS content",
   "addresses": [
    {
     "from_name": "My name",
     "esp_connection_id": 1
    }
   ]
  },
  "distribution": [
   {
    "esp_connection_id": 1,
    "domain": "default",
    "percent": 100
   }
  ],
  "message_dynamic_fields": { "test": 234, "uid": 32431 },
  "disable_unsubscribe": true
}

Appendix

SMTPs that support Cc and Bcc

  • MailGun

  • Amazon SES

  • MailJet

  • mySMTP

  • Oracle Dyn (On Request)

  • SocketLabs

  • SparkPostSendgrid