Versions Compared

Key

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

Table of Contents:

Table of Contents
minLevel2


(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. You can review the possible ways to provide List ID in this link.

Methods Summary

GET /api/lists/<List ID>

Description 

This method fetches a list.

...

Code Block
{
  "metadata": {
    "error": false
  },
  "payload": {
    "id": 12345,
    "name": "Another List",
    "notification_email": null,
    "description": "",
    "type": "sending",
    "hash_type": "",
    "last_count": 0,
    "last_active_count": 0,
    "unsubscribes": 0,
    "unsubscribe_default_link": true,
    "complaints": 0,
    "last_stats_date": null,
    "last_events_stats_date": null,
    "last_transactional_stats_date": null,
    "bounces": 0,
    "unsubscribe_success_html": null,
    "unsubscribe_confirmation_html": null,
    "unsubscribe_confirmation_button": "",
    "unsubscribe_redirect_url": null,
    "frequencies": null,
    "frequency_active": false,
    "frequency_html": null,
    "frequency_button": "",
    "frequency_field_id": null,
    "external_url_wrapper": "",
    "expiration_date": 0,
    "scope": null,
    "default_transactional_id": 12345,
    "welcome_email_id": null,
    "welcome_email_active": false,
    "welcome_email_esp_connection_id": null,
    "welcome_sms_id": null,
    "welcome_sms_active": false,
    "welcome_sms_connection_id": null,
    "welcome_sms_per_segment": null,
    "allowed_provider_connection_ids": null,
    "public_key": null,
    "image_host_base": null,
    "tracking_domain": null,
    "sms_field_id": null,
    "modified_counts": 0,
    "archive": false,
    "segment_welcome_emails": null,
    "included_segment_cache": null,
    "excluded_segment_cache": null,
    "header_template_id": null,
    "footer_template_id": null,
    "cke_keep_spaces_empty_blocks": false,
    "preprocess_minutes": null,
    "imports_concurrent_limit": 2,
    "demo_list_step": "",
    "link_query_params": null,
    "account_id": 1,
    "created": 1617541368,
    "modified": 1617541368,
    "deleted": null
  }
}

GET /api/lists

Description 

This method returns a collection of all lists in a given account, along with info regarding list type and accompanying settings of each list.

...

Code Block
{
 "metadata": {
   "error": false,
   "total": 1
 },
 "payload": [
 {
   "id": 60300,
   "account_id": 60306,
   "name": "my suppression list",
   "description": "",
   "type": "suppression",
   "last_count": 0,
   "last_active_count": 0,
   "unsubscribes": 0,
   "complaints": 0,
   "last_stats_date": null,
   "bounces": 0,
   "unsubscribe_success_html": null,
   "unsubscribe_confirmation_html": null,
   "unsubscribe_confirmation_button": "",
   "frequencies": null,
   "frequency_active": false,
   "frequency_html": null,
   "frequency_button": "",
   "external_url_wrapper": "",
   "expiration_date": 0,
   "scope": "campaign",
   "welcome_email_id": null,
   "welcome_email_active": false,
   "public_key": null,
   "image_host_base": null,
   "tracking_domain": null,
   "welcome_email_esp_connection_id": null,
   "sms_field_id": null,
   "frequency_field_id": null,
   "modified_counts": 0,
   "archive": false,
   "segment_welcome_emails": null,
   "included_segment_cache": null,
   "excluded_segment_cache": null,
   "default": false,
   "created": 1448373288,
   "modified": 1448373288,
   "deleted": null
  }
 ]
}

POST /api/lists

Description 

This method creates a new List.

...

Optional string - For "suppression" list only, "global" or "list" or "campaign". Default: "global"

...

hash_type

Optional string - For "suppression" list only, indicates if lists support contacts in md5, sha256, or sha512 format.  

Request Example - Sending list with Default Fields

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

...

Code Block
{
 "name": "my_list_name",
 "type": "sending",
 "description": "This is my list",
 "create_segment": true,
 "fields":
 [
  {
   "name": "email",
   "title": "email",
   "type": "email",
   "mandatory": true,
   "position": 0
  },
  {
   "name": "full_name",
   "title": "Full Name",
   "type": "string",
   "mandatory": false,
   "position": 1
  },
  {
   "name": "field3",
   "title": "field3",
   "type": "numeric",
   "mandatory": true,
   "position": 2
  }
 ]
}

Request Example - Suppression List

POST URL: https://api.ongage.net/api/lists

Code Block
{
"name": "suppression list test",
"description": "",
"type": "suppression"
]

Request Example - Suppression List with MD5 hashing

POST URL: https://api.ongage.net/api/lists

Code Block
{
"name": "suppression MD5 hash",
"description": "",
"type": "suppression",
"hash_type": "md5",
],
"expiration_date": ""
}

Request Example - List Level Suppression List

POST URL: https://api.ongage.net/api/lists

Code Block
{
"name": "list level suppression",
"description": "",
"type": "suppression",
"scope": "list",
"suppress_in_lists": [
"<list_id>" 
],
"expiration_date": ""
}


PUT /api/lists/<List ID>

Description 

This method updates and existing list.

...

Code Block
{
 "name": "my_list_name",
 "type": "sending",
 "description": "This is my list",
 "welcome_email_active": false,
 "unsubscribe_default_link": true,
 "unsubscribe_confirmation_html" : "<p>Are you sure you wannt to unsubscribe?</p>",
 "unsubscribe_confirmation_button" : "Unsubscribe",
 "unsubscribe_success_html": "<p>you have been successfully unsubscribe</p>",
 "frequency_active": true,
 "frequency_html" "<p>Choose how frequent would you like to receive our email</p>",
 "frequencies" : [
     {
         "active":true,
         "title":"Weekly",
         "value":"Frequency1"
     },
     {
         "active":true,
         "title":"Twice a month",
         "value":"Frequency2"
     },
     {
         "active":true,
         "title":"Monthly",
         "value":"Frequency3"
     }
  ]
}

POST /api/lists/<List ID>/copy

Description 

This method copies a list.

...

Code Block
POST api/lists/<list_id>/copy?
  Request = array (
  'create' => true,
  'name' => '<name>',
  'description' => '',
  'type' => 'sending',
  'default' => false,
)

DELETE /api/lists/<List ID>

Description 

This method deletes a list.

...