Back to top

Email Campaigns

Registered From Address

List Operations

Get All
GET/email/senderid/

Example URI

GET /email/senderid/
Request
HideShow
Headers
Content-Type: application/json
Authorization: Token 9944b09199c62bcf9418ad846dd0e4bbdfc6ee4b
Response  200
HideShow
Headers
Content-Type: application/json
Body
[
  {
    "$_id": {
      "$oid": "57bb010e2cd5264797b017e5"
    },
    "client_id": {
      "$oid": "57bb010e2cd5264797b017e5"
    },
    "description": "My From Address",
    "email": "test@test.com",
    "created_on": "2016-08-22T12:05:39.571000",
    "modified_on": "2016-08-22T12:05:39.571000"
  }
]
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "array"
}

Add
POST/email/senderid/

Example URI

POST /email/senderid/
Request
HideShow
Headers
Content-Type: application/json
Authorization: Token 9944b09199c62bcf9418ad846dd0e4bbdfc6ee4b
Body
{
  "description": "My From Address",
  "email": "test@test.com"
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "description": {
      "type": "string",
      "description": "An easy to remember name for the registered email."
    },
    "email": {
      "type": "string",
      "description": "A valid email that will be used as a from address when sending out email messages."
    }
  }
}
Response  201
HideShow
Headers
Content-Type: application/json
Body
{
  "$_id": {
    "$oid": "57bb010e2cd5264797b017e5"
  },
  "client_id": {
    "$oid": "57bb010e2cd5264797b017e5"
  },
  "description": "My From Address",
  "email": "test@test.com",
  "created_on": "2016-08-22T12:05:39.571000",
  "modified_on": "2016-08-22T12:05:39.571000"
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "$_id": {
      "type": "object",
      "properties": {
        "$oid": {
          "type": "string",
          "description": "The unique id representing the resource."
        }
      },
      "description": "The unique ID representing the resource."
    },
    "client_id": {
      "type": "object",
      "properties": {
        "$oid": {
          "type": "string",
          "description": "The unique id representing the resource."
        }
      },
      "description": "Your client ID."
    },
    "description": {
      "type": "string",
      "description": "An easy to remember name for the registered email."
    },
    "email": {
      "type": "string",
      "description": "A valid email that will be used as a from address when sending out email messages."
    },
    "created_on": {
      "type": "string",
      "description": "The date and time on which this resource was added."
    },
    "modified_on": {
      "type": "string",
      "description": "The date and time on which this resource was last modified."
    }
  }
}

Detail Operations

Get One
GET/email/senderid/?_id={_id}

Example URI

GET /email/senderid/?_id=57bb010e2cd5264797b017e5
URI Parameters
HideShow
_id
string (required) Example: 57bb010e2cd5264797b017e5

The unique ID representing this resource.

Request
HideShow
Headers
Content-Type: application/json
Authorization: Token 9944b09199c62bcf9418ad846dd0e4bbdfc6ee4b
Response  200
HideShow
Headers
Content-Type: application/json
Body
{
  "$_id": {
    "$oid": "57bb010e2cd5264797b017e5"
  },
  "client_id": {
    "$oid": "57bb010e2cd5264797b017e5"
  },
  "description": "My From Address",
  "email": "test@test.com",
  "created_on": "2016-08-22T12:05:39.571000",
  "modified_on": "2016-08-22T12:05:39.571000"
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "$_id": {
      "type": "object",
      "properties": {
        "$oid": {
          "type": "string",
          "description": "The unique id representing the resource."
        }
      },
      "description": "The unique ID representing the resource."
    },
    "client_id": {
      "type": "object",
      "properties": {
        "$oid": {
          "type": "string",
          "description": "The unique id representing the resource."
        }
      },
      "description": "Your client ID."
    },
    "description": {
      "type": "string",
      "description": "An easy to remember name for the registered email."
    },
    "email": {
      "type": "string",
      "description": "A valid email that will be used as a from address when sending out email messages."
    },
    "created_on": {
      "type": "string",
      "description": "The date and time on which this resource was added."
    },
    "modified_on": {
      "type": "string",
      "description": "The date and time on which this resource was last modified."
    }
  }
}

Update
PUT/email/senderid/?_id={_id}

Example URI

PUT /email/senderid/?_id=57bb010e2cd5264797b017e5
URI Parameters
HideShow
_id
string (required) Example: 57bb010e2cd5264797b017e5

The unique ID representing the registered number resource.

Request
HideShow
Headers
Content-Type: application/json
Authorization: Token 9944b09199c62bcf9418ad846dd0e4bbdfc6ee4b
Body
{
  "description": "My From Address",
  "email": "test@test.com"
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "description": {
      "type": "string",
      "description": "An easy to remember name for the registered email."
    },
    "email": {
      "type": "string",
      "description": "A valid email that will be used as a from address when sending out email messages."
    }
  }
}
Response  204
HideShow
Headers
Content-Type: application/json
Response  404
HideShow
Headers
Content-Type: application/json

Delete
DELETE/email/senderid/?_id={_id}

Example URI

DELETE /email/senderid/?_id=57bb010e2cd5264797b017e5
URI Parameters
HideShow
_id
string (required) Example: 57bb010e2cd5264797b017e5

The unique ID representing the registered number resource.

Request
HideShow
Headers
Content-Type: application/json
Authorization: Token 9944b09199c62bcf9418ad846dd0e4bbdfc6ee4b
Response  204
HideShow
Headers
Content-Type: application/json
Response  404
HideShow
Headers
Content-Type: application/json

Opt-Out

List Operations

Get All
GET/email/optout/

Example URI

GET /email/optout/
Request
HideShow
Headers
Content-Type: application/json
Authorization: Token 9944b09199c62bcf9418ad846dd0e4bbdfc6ee4b
Response  200
HideShow
Headers
Content-Type: application/json
Body
[
  {
    "$_id": {
      "$oid": "57bb010e2cd5264797b017e5"
    },
    "client_id": {
      "$oid": "57bb010e2cd5264797b017e5"
    },
    "email": "test@test.com",
    "created_on": "2016-08-22T12:05:39.571000",
    "modified_on": "2016-08-22T12:05:39.571000"
  }
]
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "array"
}

Add
POST/email/optout/

Example URI

POST /email/optout/
Request
HideShow
Headers
Content-Type: application/json
Authorization: Token 9944b09199c62bcf9418ad846dd0e4bbdfc6ee4b
Body
{
  "email": "test@test.com"
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "email": {
      "type": "string",
      "description": "The email address that should be added to the blacklist."
    }
  }
}
Response  201
HideShow
Headers
Content-Type: application/json
Body
{
  "$_id": {
    "$oid": "57bb010e2cd5264797b017e5"
  },
  "client_id": {
    "$oid": "57bb010e2cd5264797b017e5"
  },
  "email": "test@test.com",
  "created_on": "2016-08-22T12:05:39.571000",
  "modified_on": "2016-08-22T12:05:39.571000"
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "$_id": {
      "type": "object",
      "properties": {
        "$oid": {
          "type": "string",
          "description": "The unique id representing the resource."
        }
      },
      "description": "The unique ID representing the resource."
    },
    "client_id": {
      "type": "object",
      "properties": {
        "$oid": {
          "type": "string",
          "description": "The unique id representing the resource."
        }
      },
      "description": "Your client ID."
    },
    "email": {
      "type": "string",
      "description": "The email address that should be added to the blacklist."
    },
    "created_on": {
      "type": "string",
      "description": "The date and time on which this resource was added."
    },
    "modified_on": {
      "type": "string",
      "description": "The date and time on which this resource was last modified."
    }
  }
}

Detail Operations

Get One
GET/email/optout/?_id={_id}

Example URI

GET /email/optout/?_id=57bb010e2cd5264797b017e5
URI Parameters
HideShow
_id
string (required) Example: 57bb010e2cd5264797b017e5

The unique ID representing the DNC email resource.

Request
HideShow
Headers
Content-Type: application/json
Authorization: Token 9944b09199c62bcf9418ad846dd0e4bbdfc6ee4b
Response  200
HideShow
Headers
Content-Type: application/json
Body
{
  "$_id": {
    "$oid": "57bb010e2cd5264797b017e5"
  },
  "client_id": {
    "$oid": "57bb010e2cd5264797b017e5"
  },
  "email": "test@test.com",
  "created_on": "2016-08-22T12:05:39.571000",
  "modified_on": "2016-08-22T12:05:39.571000"
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "$_id": {
      "type": "object",
      "properties": {
        "$oid": {
          "type": "string",
          "description": "The unique id representing the resource."
        }
      },
      "description": "The unique ID representing the resource."
    },
    "client_id": {
      "type": "object",
      "properties": {
        "$oid": {
          "type": "string",
          "description": "The unique id representing the resource."
        }
      },
      "description": "Your client ID."
    },
    "email": {
      "type": "string",
      "description": "The email address that should be added to the blacklist."
    },
    "created_on": {
      "type": "string",
      "description": "The date and time on which this resource was added."
    },
    "modified_on": {
      "type": "string",
      "description": "The date and time on which this resource was last modified."
    }
  }
}
Response  404
HideShow
Headers
Content-Type: application/json

Update
PUT/email/optout/?_id={_id}

Example URI

PUT /email/optout/?_id=57bb010e2cd5264797b017e5
URI Parameters
HideShow
_id
string (required) Example: 57bb010e2cd5264797b017e5

The unique ID representing the DNC email resource.

Request
HideShow
Headers
Content-Type: application/json
Authorization: Token 9944b09199c62bcf9418ad846dd0e4bbdfc6ee4b
Body
{
  "email": "test@test.com"
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "email": {
      "type": "string",
      "description": "The email address that should be added to the blacklist."
    }
  }
}
Response  204
HideShow
Headers
Content-Type: application/json
Response  404
HideShow
Headers
Content-Type: application/json

Delete
DELETE/email/optout/?_id={_id}

Example URI

DELETE /email/optout/?_id=57bb010e2cd5264797b017e5
URI Parameters
HideShow
_id
string (required) Example: 57bb010e2cd5264797b017e5

The unique ID representing the DNC email resource.

Request
HideShow
Headers
Content-Type: application/json
Authorization: Token 9944b09199c62bcf9418ad846dd0e4bbdfc6ee4b
Response  204
HideShow
Headers
Content-Type: application/json
Response  404
HideShow
Headers
Content-Type: application/json

Bulk Operations

Bulk Add
POST/email/optout/bulk/add/

FormData Key Reference
csv_file The CSV file that needs to be processed.

Example URI

POST /email/optout/bulk/add/
Request
HideShow
Headers
Content-Type: multipart/form-data, boundary=---BOUNDARY
Authorization: Token 9944b09199c62bcf9418ad846dd0e4bbdfc6ee4b
Body
---BOUNDARY
Content-Disposition: form-data; name="csv_file"; filename="your_file.csv"
Content-Type: text/csv

---BOUNDARY
Response  200

Bulk Delete
POST/email/optout/bulk/delete/

FormData Key Reference
csv_file The CSV file that needs to be processed.

Example URI

POST /email/optout/bulk/delete/
Request
HideShow
Headers
Content-Type: multipart/form-data, boundary=---BOUNDARY
Authorization: Token 9944b09199c62bcf9418ad846dd0e4bbdfc6ee4b
Body
---BOUNDARY
Content-Disposition: form-data; name="csv_file"; filename="your_file.csv"
Content-Type: text/csv

---BOUNDARY
Response  200

Contact Groups

List Operations

Get All
GET/email/contact/

Example URI

GET /email/contact/
Request
HideShow
Headers
Content-Type: application/json
Authorization: Token 9944b09199c62bcf9418ad846dd0e4bbdfc6ee4b
Response  200
HideShow
Headers
Content-Type: application/json
Body
[
  {
    "$_id": {
      "$oid": "57bb010e2cd5264797b017e5"
    },
    "client_id": {
      "$oid": "57bb010e2cd5264797b017e5"
    },
    "tag": "My Contact Group",
    "contacts": [
      {
        "name": "John Doe",
        "email": "test@test.com"
      }
    ],
    "created_on": "2016-08-22T12:05:39.571000",
    "modified_on": "2016-08-22T12:05:39.571000"
  }
]
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "array"
}

Add
POST/email/contact/

Note: You can only create a contact group using this request. To manage contacts in this group, use the bulk operation endpoints listed below.

Example URI

POST /email/contact/
Request
HideShow
Headers
Content-Type: application/json
Authorization: Token 9944b09199c62bcf9418ad846dd0e4bbdfc6ee4b
Body
{
  "tag": "My Contact Group"
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "tag": {
      "type": "string",
      "description": "A friendly name for your contact group."
    }
  }
}
Response  201
HideShow
Headers
Content-Type: application/json
Body
{
  "$_id": {
    "$oid": "57bb010e2cd5264797b017e5"
  },
  "client_id": {
    "$oid": "57bb010e2cd5264797b017e5"
  },
  "tag": "My Contact Group",
  "contacts": [
    {
      "name": "John Doe",
      "email": "test@test.com"
    }
  ],
  "created_on": "2016-08-22T12:05:39.571000",
  "modified_on": "2016-08-22T12:05:39.571000"
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "$_id": {
      "type": "object",
      "properties": {
        "$oid": {
          "type": "string",
          "description": "The unique id representing the resource."
        }
      },
      "description": "The unique ID representing the resource."
    },
    "client_id": {
      "type": "object",
      "properties": {
        "$oid": {
          "type": "string",
          "description": "The unique id representing the resource."
        }
      },
      "description": "Your client ID."
    },
    "tag": {
      "type": "string",
      "description": "A friendly name for your contact group."
    },
    "contacts": {
      "type": "array"
    },
    "created_on": {
      "type": "string",
      "description": "The date and time this resource was created."
    },
    "modified_on": {
      "type": "string",
      "description": "The date and time this resource was modified."
    }
  }
}

Detail Operations

Get One
GET/email/contact/?_id={_id}

Example URI

GET /email/contact/?_id=57bb010e2cd5264797b017e5
URI Parameters
HideShow
_id
string (required) Example: 57bb010e2cd5264797b017e5

The unique ID representing the contact group resource.

Request
HideShow
Headers
Content-Type: application/json
Authorization: Token 9944b09199c62bcf9418ad846dd0e4bbdfc6ee4b
Response  200
HideShow
Headers
Content-Type: application/json
Body
{
  "$_id": {
    "$oid": "57bb010e2cd5264797b017e5"
  },
  "client_id": {
    "$oid": "57bb010e2cd5264797b017e5"
  },
  "tag": "My Contact Group",
  "contacts": [
    {
      "name": "John Doe",
      "email": "test@test.com"
    }
  ],
  "created_on": "2016-08-22T12:05:39.571000",
  "modified_on": "2016-08-22T12:05:39.571000"
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "$_id": {
      "type": "object",
      "properties": {
        "$oid": {
          "type": "string",
          "description": "The unique id representing the resource."
        }
      },
      "description": "The unique ID representing the resource."
    },
    "client_id": {
      "type": "object",
      "properties": {
        "$oid": {
          "type": "string",
          "description": "The unique id representing the resource."
        }
      },
      "description": "Your client ID."
    },
    "tag": {
      "type": "string",
      "description": "A friendly name for your contact group."
    },
    "contacts": {
      "type": "array"
    },
    "created_on": {
      "type": "string",
      "description": "The date and time this resource was created."
    },
    "modified_on": {
      "type": "string",
      "description": "The date and time this resource was modified."
    }
  }
}
Response  404
HideShow
Headers
Content-Type: application/json

Update
PUT/email/contact/?_id={_id}

Note: You can only update a contact group’s tag using this request. To manage contacts in this group, use the bulk operation endpoints listed below.

Example URI

PUT /email/contact/?_id=57bb010e2cd5264797b017e5
URI Parameters
HideShow
_id
string (required) Example: 57bb010e2cd5264797b017e5

The unique ID representing the contact group resource.

Request
HideShow
Headers
Content-Type: application/json
Authorization: Token 9944b09199c62bcf9418ad846dd0e4bbdfc6ee4b
Body
{
  "tag": "My Contact Group"
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "tag": {
      "type": "string",
      "description": "A friendly name for your contact group."
    }
  }
}
Response  200
HideShow
Headers
Content-Type: application/json
Body
{
  "$_id": {
    "$oid": "57bb010e2cd5264797b017e5"
  },
  "client_id": {
    "$oid": "57bb010e2cd5264797b017e5"
  },
  "tag": "My Contact Group",
  "contacts": [
    {
      "name": "John Doe",
      "email": "test@test.com"
    }
  ],
  "created_on": "2016-08-22T12:05:39.571000",
  "modified_on": "2016-08-22T12:05:39.571000"
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "$_id": {
      "type": "object",
      "properties": {
        "$oid": {
          "type": "string",
          "description": "The unique id representing the resource."
        }
      },
      "description": "The unique ID representing the resource."
    },
    "client_id": {
      "type": "object",
      "properties": {
        "$oid": {
          "type": "string",
          "description": "The unique id representing the resource."
        }
      },
      "description": "Your client ID."
    },
    "tag": {
      "type": "string",
      "description": "A friendly name for your contact group."
    },
    "contacts": {
      "type": "array"
    },
    "created_on": {
      "type": "string",
      "description": "The date and time this resource was created."
    },
    "modified_on": {
      "type": "string",
      "description": "The date and time this resource was modified."
    }
  }
}
Response  404
HideShow
Headers
Content-Type: application/json

Delete
DELETE/email/contact/?_id={_id}

Example URI

DELETE /email/contact/?_id=57bb010e2cd5264797b017e5
URI Parameters
HideShow
_id
string (required) Example: 57bb010e2cd5264797b017e5

The unique ID representing the contact group resource.

Request
HideShow
Headers
Content-Type: application/json
Authorization: Token 9944b09199c62bcf9418ad846dd0e4bbdfc6ee4b
Response  204
HideShow
Headers
Content-Type: application/json
Response  404
HideShow
Headers
Content-Type: application/json

Bulk Operations

Bulk Replace
POST/email/contact/bulk/replace/?_id={_id}

Bulk replace will overwrite ALL contacts in the group with the contacts from your file. This is the recommended approach while dealing with very large contact groups.

Note: The index of the first column starts with zero.

FormData Key Reference
name_index The index of the name column in the CSV file. Note that indexes start from 0.
email_index The index of the email column in the CSV file. Note that indexes start from 0.
csv_file The CSV file that needs to be processed.

Example URI

POST /email/contact/bulk/replace/?_id=57bb010e2cd5264797b017e5
URI Parameters
HideShow
_id
string (required) Example: 57bb010e2cd5264797b017e5

The unique ID representing the contact group resource.

Request
HideShow
Headers
Content-Type: multipart/form-data, boundary=---BOUNDARY
Authorization: Token 9944b09199c62bcf9418ad846dd0e4bbdfc6ee4b
Body
---BOUNDARY
Content-Disposition: form-data; name="name_index"

0
---BOUNDARY
Content-Disposition: form-data; name="email_index"

1
---BOUNDARY
Content-Disposition: form-data; name="csv_file"; filename="your_file.csv"
Content-Type: text/csv

---BOUNDARY
Response  200

Bulk Update
POST/email/contact/bulk/update/?_id={_id}

Bulk update let’s you add or update existing records. The CSV file uploaded should contain the name and email of the contact. Other fields in the CSV files can be added for your reference. These additional fields will be used while generating reports. The CSV file should contain a header row that identifies the various columns present.

Note: The index of the first column starts with zero.

FormData Key Reference
name_index The index of the name column in the CSV file. Note that indexes start from 0.
email_index The index of the email column in the CSV file. Note that indexes start from 0.
csv_file The CSV file that needs to be processed.

Example URI

POST /email/contact/bulk/update/?_id=57bb010e2cd5264797b017e5
URI Parameters
HideShow
_id
string (required) Example: 57bb010e2cd5264797b017e5

The unique ID representing the contact group resource.

Request
HideShow
Headers
Content-Type: multipart/form-data, boundary=---BOUNDARY
Authorization: Token 9944b09199c62bcf9418ad846dd0e4bbdfc6ee4b
Body
---BOUNDARY
Content-Disposition: form-data; name="name_index"

0
---BOUNDARY
Content-Disposition: form-data; name="email_index"

1
---BOUNDARY
Content-Disposition: form-data; name="csv_file"; filename="your_file.csv"
Content-Type: text/csv

---BOUNDARY
Response  200

Bulk Delete
POST/email/contact/bulk/delete/?_id={_id}

Bulk delete let’s you delete contacts based on their email address.

Note: The index of the first column starts with zero.

FormData Key Reference
email_index The index of the email column in the CSV file. Note that indexes start from 0.
csv_file The CSV file that needs to be processed.

Example URI

POST /email/contact/bulk/delete/?_id=57bb010e2cd5264797b017e5
URI Parameters
HideShow
_id
string (required) Example: 57bb010e2cd5264797b017e5

The unique ID representing the contact group resource.

Request
HideShow
Headers
Content-Type: multipart/form-data, boundary=---BOUNDARY
Authorization: Token 9944b09199c62bcf9418ad846dd0e4bbdfc6ee4b
Body
---BOUNDARY
Content-Disposition: form-data; name="email_index"

1
---BOUNDARY
Content-Disposition: form-data; name="csv_file"; filename="your_file.csv"
Content-Type: text/csv

---BOUNDARY
Response  200

Message

List Operations

Get All
GET/email/message/

Example URI

GET /email/message/
Request
HideShow
Headers
Content-Type: application/json
Authorization: Token 9944b09199c62bcf9418ad846dd0e4bbdfc6ee4b
Response  200
HideShow
Headers
Content-Type: application/json
Body
[
  {
    "$_id": {
      "$oid": "57bb010e2cd5264797b017e5"
    },
    "client_id": {
      "$oid": "57bb010e2cd5264797b017e5"
    },
    "description": "My message",
    "email_message": "This is a test message.",
    "created_on": "2016-08-22T12:05:39.571000",
    "modified_on": "2016-08-22T12:05:39.571000"
  }
]
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "array"
}

Add
POST/email/message/

Example URI

POST /email/message/
Request
HideShow
Headers
Content-Type: application/json
Authorization: Token 9944b09199c62bcf9418ad846dd0e4bbdfc6ee4b
Body
{
  "description": "My message",
  "email_message": "This is a test message."
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "description": {
      "type": "string",
      "description": "A friendly name for your email. This will also be the subject of your email."
    },
    "email_message": {
      "type": "string",
      "description": "The contents of the email that will be sent to your contact group."
    }
  }
}
Response  201
HideShow
Headers
Content-Type: application/json
Body
{
  "$_id": {
    "$oid": "57bb010e2cd5264797b017e5"
  },
  "client_id": {
    "$oid": "57bb010e2cd5264797b017e5"
  },
  "description": "My message",
  "email_message": "This is a test message.",
  "created_on": "2016-08-22T12:05:39.571000",
  "modified_on": "2016-08-22T12:05:39.571000"
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "$_id": {
      "type": "object",
      "properties": {
        "$oid": {
          "type": "string",
          "description": "The unique id representing the resource."
        }
      },
      "description": "The unique ID representing the resource."
    },
    "client_id": {
      "type": "object",
      "properties": {
        "$oid": {
          "type": "string",
          "description": "The unique id representing the resource."
        }
      },
      "description": "Your client ID."
    },
    "description": {
      "type": "string",
      "description": "A friendly name for your email. This will also be the subject of your email."
    },
    "email_message": {
      "type": "string",
      "description": "The contents of the email that will be sent to your contact group."
    },
    "created_on": {
      "type": "string",
      "description": "The date and time this resource was created."
    },
    "modified_on": {
      "type": "string",
      "description": "The date and time this resource was last modified."
    }
  }
}

Detail Operations

Get One
GET/email/message/?_id={_id}

Example URI

GET /email/message/?_id=57bb010e2cd5264797b017e5
URI Parameters
HideShow
_id
string (required) Example: 57bb010e2cd5264797b017e5

The unique ID representing the message resource.

Request
HideShow
Headers
Content-Type: application/json
Authorization: Token 9944b09199c62bcf9418ad846dd0e4bbdfc6ee4b
Response  200
HideShow
Headers
Content-Type: application/json
Body
{
  "$_id": {
    "$oid": "57bb010e2cd5264797b017e5"
  },
  "client_id": {
    "$oid": "57bb010e2cd5264797b017e5"
  },
  "description": "My message",
  "email_message": "This is a test message.",
  "created_on": "2016-08-22T12:05:39.571000",
  "modified_on": "2016-08-22T12:05:39.571000"
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "$_id": {
      "type": "object",
      "properties": {
        "$oid": {
          "type": "string",
          "description": "The unique id representing the resource."
        }
      },
      "description": "The unique ID representing the resource."
    },
    "client_id": {
      "type": "object",
      "properties": {
        "$oid": {
          "type": "string",
          "description": "The unique id representing the resource."
        }
      },
      "description": "Your client ID."
    },
    "description": {
      "type": "string",
      "description": "A friendly name for your email. This will also be the subject of your email."
    },
    "email_message": {
      "type": "string",
      "description": "The contents of the email that will be sent to your contact group."
    },
    "created_on": {
      "type": "string",
      "description": "The date and time this resource was created."
    },
    "modified_on": {
      "type": "string",
      "description": "The date and time this resource was last modified."
    }
  }
}
Response  404
HideShow
Headers
Content-Type: application/json

Update
PUT/email/message/?_id={_id}

Example URI

PUT /email/message/?_id=57bb010e2cd5264797b017e5
URI Parameters
HideShow
_id
string (required) Example: 57bb010e2cd5264797b017e5

The unique ID representing the message resource.

Request
HideShow
Headers
Content-Type: application/json
Authorization: Token 9944b09199c62bcf9418ad846dd0e4bbdfc6ee4b
Body
{
  "description": "My message",
  "email_message": "This is a test message."
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "description": {
      "type": "string",
      "description": "A friendly name for your email. This will also be the subject of your email."
    },
    "email_message": {
      "type": "string",
      "description": "The contents of the email that will be sent to your contact group."
    }
  }
}
Response  204
HideShow
Headers
Content-Type: application/json
Response  404
HideShow
Headers
Content-Type: application/json

Delete
DELETE/email/message/?_id={_id}

Example URI

DELETE /email/message/?_id=57bb010e2cd5264797b017e5
URI Parameters
HideShow
_id
string (required) Example: 57bb010e2cd5264797b017e5

The unique ID representing the message resource.

Request
HideShow
Headers
Content-Type: application/json
Authorization: Token 9944b09199c62bcf9418ad846dd0e4bbdfc6ee4b
Response  204
HideShow
Headers
Content-Type: application/json
Response  404
HideShow
Headers
Content-Type: application/json

Email Results

List Operations

Get All
GET/email/result/filter/?start_date={start_date}&end_date={end_date}&campaign_id={campaign_id}

Example URI

GET /email/result/filter/?start_date=2016-08-01&end_date=2016-09-01&campaign_id=57bb010e2cd5264797b017e5
URI Parameters
HideShow
start_date
string (required) Example: 2016-08-01

The date of the period from which you want results

end_date
string (required) Example: 2016-09-01

The date of the period until which you want results

campaign_id
string (optional) Example: 57bb010e2cd5264797b017e5

The unique id representing the campaign resource. When specified, results returned will be limited to the campaign.

Request
HideShow
Headers
Content-Type: application/json
Authorization: Token 9944b09199c62bcf9418ad846dd0e4bbdfc6ee4b
Response  200
HideShow
Headers
Content-Type: application/json
Body
[
  {
    "$_id": {
      "$oid": "57bb010e2cd5264797b017e5"
    },
    "client_id": {
      "$oid": "57bb010e2cd5264797b017e5"
    },
    "queue_id": {
      "$oid": "57bb010e2cd5264797b017e5"
    },
    "campaign_id": {
      "$oid": "57bb010e2cd5264797b017e5"
    },
    "contact": {},
    "campaign_name": "My Campaign",
    "disposition": "delivered",
    "start_date": "2016-08-22T12:05:39.571000",
    "modified_on": "2016-08-22T12:05:39.571000",
    "email_to": "test@test.com",
    "email_from_id": "test@test.com",
    "complete": true,
    "status": "completed"
  }
]
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "array"
}

Campaign

List Operations

Get All
GET/email/campaign/

Example URI

GET /email/campaign/
Request
HideShow
Headers
Content-Type: application/json
Authorization: Token 9944b09199c62bcf9418ad846dd0e4bbdfc6ee4b
Response  200
HideShow
Headers
Content-Type: application/json
Body
[
  {
    "$_id": {
      "$oid": "57bb010e2cd5264797b017e5"
    },
    "client_id": {
      "$oid": "57bb010e2cd5264797b017e5"
    },
    "contact_group_id": {
      "$oid": "57bb010e2cd5264797b017e5"
    },
    "sender_id": {
      "$oid": "57bb010e2cd5264797b017e5"
    },
    "message_id": {
      "$oid": "57bb010e2cd5264797b017e5"
    },
    "name": "My Campaign",
    "start_date": "2016-08-22T12:05:39.571000",
    "timezone": "EST5EDT",
    "created_on": "2016-08-22T12:05:39.571000",
    "modified_on": "2016-08-22T12:05:39.571000",
    "status": "active"
  }
]
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "array"
}

Add
POST/email/campaign/

The campaign request should be of type multipart/form-data with the following keys:

FormData Key Reference
attributes A JSON string describing the attributes of the campaign being added.
csv_file The CSV file containing the details of the contact group to whom the emails should be sent out. Required if the type of the contact group is upload.

The attributes parameter is a JSON string which has the following structure:

{
    "message": {},
    "contact_group": {},
    "schedule": {}
}

The actual parameters for each of the objects in the above structure depend on the type of the audio dialog, contact group and schedule desired. The following tables indicate acceptable values for each of these objects.

The message Object:

JSON String Key Data Type Reference Required When
source string Indicates the type of message resource being used. Allowed values include: upload, new Always
description number A friendly name for the message resource. This will be used as the subject for the email. source: new
email_message string The actual email message that needs to be sent to the contacts. source: new
_id $oid object The unique ID representing the message resource. source: reuse

The contact_group Object:

JSON String Key Data Type Reference Required When
type string Indicates the type of contact group resource being used. Allowed values include: upload, reuse Always
name_index number The index of the column in the CSV file which contains the name of the contacts. type: upload
email_index number The index of the column in the CSV file which contains the email of the contacts. type: upload
_id $oid object The unique ID representing the contact group resource. type: reuse

The schedule Object:

JSON String Key Data Type Reference Required When
name string A friendly name for the campaign resource. Always
start_date string The start of the datetime window in which emailing can be attempted. The date should be formatted as yyyy-MM-dd HH:mm. Always
timezone string Indicates the timezone of the email start and end windows. Allowed values include: EST5EDT, CST6CDT, MST7MDT, PST8PDT Always
sender_id $oid object The unique ID representing the registered email that should be used as the from address. Always

Example URI

POST /email/campaign/
Request
HideShow
Headers
Content-Type: multipart/form-data, boundary=---BOUNDARY
Authorization: Token 9944b09199c62bcf9418ad846dd0e4bbdfc6ee4b
Body
---BOUNDARY
Content-Disposition: form-data; name="attributes"

{
    "message": {
        "source": "new",
        "description": "My Email Message",
        "email_message": "This is a test message."
    },
    "contact_group": {
        "type": "upload",
        "name_index": 1,
        "email_index": 0
    },
    "schedule": {
        "name": "My Campaign",
        "start_date": "2016-09-08 09:00",
        "timezone": "EST5EDT",
        "sender_id": {
            "$oid": "57bba6fac75dae266c4aee1f"
        }
    }
}
---BOUNDARY
Content-Disposition: form-data; name="csv_file"; filename="your_contacts.csv"
Content-Type: text/csv

---BOUNDARY
Response  201
HideShow
Headers
Content-Type: application/json
Body
{
  "$_id": {
    "$oid": "57bb010e2cd5264797b017e5"
  },
  "client_id": {
    "$oid": "57bb010e2cd5264797b017e5"
  },
  "contact_group_id": {
    "$oid": "57bb010e2cd5264797b017e5"
  },
  "sender_id": {
    "$oid": "57bb010e2cd5264797b017e5"
  },
  "message_id": {
    "$oid": "57bb010e2cd5264797b017e5"
  },
  "name": "My Campaign",
  "start_date": "2016-08-22T12:05:39.571000",
  "timezone": "EST5EDT",
  "created_on": "2016-08-22T12:05:39.571000",
  "modified_on": "2016-08-22T12:05:39.571000",
  "status": "active"
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "$_id": {
      "type": "object",
      "properties": {
        "$oid": {
          "type": "string",
          "description": "The unique id representing the resource."
        }
      },
      "description": "The unique ID representing the resource."
    },
    "client_id": {
      "type": "object",
      "properties": {
        "$oid": {
          "type": "string",
          "description": "The unique id representing the resource."
        }
      },
      "description": "Your client ID."
    },
    "contact_group_id": {
      "type": "object",
      "properties": {
        "$oid": {
          "type": "string",
          "description": "The unique id representing the resource."
        }
      },
      "description": "The unique ID representing this resource."
    },
    "message_id": {
      "type": "object",
      "properties": {
        "$oid": {
          "type": "string",
          "description": "The unique id representing the resource."
        }
      },
      "description": "The unique ID representing this resource."
    },
    "name": {
      "type": "string",
      "description": "The name of the campaign."
    },
    "start_date": {
      "type": "string",
      "description": "The start of the date time window in which the email can be attempted."
    },
    "timezone": {
      "type": "string",
      "enum": [
        "EST5EDT",
        "CST6CDT",
        "MST7MDT",
        "PST8PDT"
      ],
      "description": "Indicates the timezone of the email start window."
    },
    "sender_id": {
      "type": "object",
      "properties": {
        "$oid": {
          "type": "string",
          "description": "The unique id representing the resource."
        }
      },
      "description": "The unique ID representing the registered number that should be used for the registered from address."
    },
    "created_on": {
      "type": "string",
      "description": "The date and time this resource was created."
    },
    "modified_on": {
      "type": "string",
      "description": "The date and time this resource was modified."
    },
    "status": {
      "type": "string",
      "description": "Indicates the status of the campaign."
    }
  }
}

Detail Operations

Get One
GET/email/campaign/?_id={_id}

Example URI

GET /email/campaign/?_id=57bb010e2cd5264797b017e5
URI Parameters
HideShow
_id
string (required) Example: 57bb010e2cd5264797b017e5

The unique ID representing the campaign resource.

Request
HideShow
Headers
Content-Type: application/json
Authorization: Token 9944b09199c62bcf9418ad846dd0e4bbdfc6ee4b
Response  200
HideShow
Headers
Content-Type: application/json
Body
{
  "$_id": {
    "$oid": "57bb010e2cd5264797b017e5"
  },
  "client_id": {
    "$oid": "57bb010e2cd5264797b017e5"
  },
  "contact_group_id": {
    "$oid": "57bb010e2cd5264797b017e5"
  },
  "sender_id": {
    "$oid": "57bb010e2cd5264797b017e5"
  },
  "message_id": {
    "$oid": "57bb010e2cd5264797b017e5"
  },
  "name": "My Campaign",
  "start_date": "2016-08-22T12:05:39.571000",
  "timezone": "EST5EDT",
  "created_on": "2016-08-22T12:05:39.571000",
  "modified_on": "2016-08-22T12:05:39.571000",
  "status": "active"
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "$_id": {
      "type": "object",
      "properties": {
        "$oid": {
          "type": "string",
          "description": "The unique id representing the resource."
        }
      },
      "description": "The unique ID representing the resource."
    },
    "client_id": {
      "type": "object",
      "properties": {
        "$oid": {
          "type": "string",
          "description": "The unique id representing the resource."
        }
      },
      "description": "Your client ID."
    },
    "contact_group_id": {
      "type": "object",
      "properties": {
        "$oid": {
          "type": "string",
          "description": "The unique id representing the resource."
        }
      },
      "description": "The unique ID representing this resource."
    },
    "message_id": {
      "type": "object",
      "properties": {
        "$oid": {
          "type": "string",
          "description": "The unique id representing the resource."
        }
      },
      "description": "The unique ID representing this resource."
    },
    "name": {
      "type": "string",
      "description": "The name of the campaign."
    },
    "start_date": {
      "type": "string",
      "description": "The start of the date time window in which the email can be attempted."
    },
    "timezone": {
      "type": "string",
      "enum": [
        "EST5EDT",
        "CST6CDT",
        "MST7MDT",
        "PST8PDT"
      ],
      "description": "Indicates the timezone of the email start window."
    },
    "sender_id": {
      "type": "object",
      "properties": {
        "$oid": {
          "type": "string",
          "description": "The unique id representing the resource."
        }
      },
      "description": "The unique ID representing the registered number that should be used for the registered from address."
    },
    "created_on": {
      "type": "string",
      "description": "The date and time this resource was created."
    },
    "modified_on": {
      "type": "string",
      "description": "The date and time this resource was modified."
    },
    "status": {
      "type": "string",
      "description": "Indicates the status of the campaign."
    }
  }
}
Response  404
HideShow
Headers
Content-Type: application/json

Update
PUT/email/campaign/?_id={_id}

Example URI

PUT /email/campaign/?_id=57bb010e2cd5264797b017e5
URI Parameters
HideShow
_id
string (required) Example: 57bb010e2cd5264797b017e5

The unique ID representing the campaign resource.

Request
HideShow
Headers
Content-Type: application/json
Authorization: Token 9944b09199c62bcf9418ad846dd0e4bbdfc6ee4b
Body
{
  "status": "active"
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "status": {
      "type": "string",
      "enum": [
        "active",
        "paused",
        "cancelled"
      ],
      "description": "Control the status of the campaign."
    }
  }
}
Response  204
HideShow
Headers
Content-Type: application/json
Response  404
HideShow
Headers
Content-Type: application/json

Generated by aglio on 12 Jan 2018