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. 

Methods Summary

GET /

...

api/import/<Import ID>

Description 

This method returns a single import.

Response Example

GET URL: https://api.ongage.net/<list_id>/api/import/1112223334

Code Block
{
  "metadata": {
    "error": false
  },
  "payload": {
    "id": 83513,
    "account_id": "60306",
    "list_id": 1234,
    "type": "import",
    "action": "add",
    "name": "filename.csv",
    "file": "4564ef337b1ae36e",
    "imported_by": "1035",
    "is_override": false,
    "save_report": true,
    "send_welcome_message": false,
    "send_email_notification": "0",
    "csv_delimiter": ",",
    "encoding": "UTF-8",
    "progress": "0",
    "size": "0",
    "total": "10",
    "success": "8",
    "failed": "0",
    "duplicate": "2",
    "existing": "0",
    "not_existing": "0",
    "incomplete": "0",
    "invalid": "0",
    "status": 40003,
    "status_desc": "Complete",
    "created": 1461079510,
    "modified": 1461079510,
    "deleted": "0"
  }
}

...

"40001": "Queued"
"40010": "Validating"
"40002": "Processing"
"40003": "Completed"
"40004": "Updating list stats"
"90001": "Error"
"90008": "Invalid"
(info)  Any status >= 90000 are final statuses of errors.

GET /

...

api/import

Description 

This method returns paginated import results in response.

POST /

...

api/import

Description 

This method is used to create an import.

...

Request Example - Sending List Import

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

Code Block
{
 "list_id": 1234,
 "file_url": "http://www.yourdomain.com/filename.csv",
 "csv_delimiter": ",",
 "encoding": "UTF-8",
 "overwrite": false,
 "ignore_empty": true,
 "send_welcome_message": false,
 "fields":
 {
  "email":
  {
   "name": "email",
   "type": "email",
   "format": "",
   "default": ""
  },
  "address":
  {
   "name": "address",
   "type": "string",
   "format": "",
   "default": ""
  },
  "country":
  {
   "name": "country",
   "type": "string",
   "format": "",
   "default": ""
  }
 }
}

Request Example - Suppression list import

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

Code Block
{
"list_id": 1234,
"file_url": "http://www.yourdomain.com/filename.csv",
"csv_delimiter": ",",
"import_type" : "suppression",
"import_action" : "add"
}

...

  • 403 - Permission error
  • 500 - Validation error

Password Protect Import File Feature

  • You can password protect the the file you want to import, by zipping it up into a zip file, and setting a password on that zip file.
  • In order for Ongage to then be able to open that file, go to the Account General Settings Page, and enter there the password needed to open the zip file.


Additional Security Measures Beyond Password Protection

The API import call requires indicating a URL to the import file. You can secure that URL in the following manner:

  • Place the file just prior to the import and delete the file right after the import.
  • On the client's web servers (regardless of which web server) there is always an accesslog. If the file is deleted from the server after Ongage downloaded it + if the access log doesn't show any other download other than Ongage, it means the data is safe.
  • Disabling directory indexing.
  • Renaming the import files to a random and long string will also help protecting against people finding the URL as long as directory indexing is disabled.
  • You can make the directory accessible only to your IPs and Ongage's IPs. Ask Ongage support for how to obtain a list of Ongage IPs.
  • Finally, as an additional security measure you can use https instead of http.

How to Import a file from an S3 bucket

Prerequisites

  • You have AWS account.
  • You have an S3 bucket (With the name ‘my_company_name_ongage_imports’ for example).

...