Introduction
Welcome to the Spotzee Marketing App’s API documentation site. Join us in our journey to become the best omnichannel marketing platform driven by intelligence and advanced automation. You can use our powerful API to integrate into 3rd party applications (Eg. Zapier) or custom apps. The API documentation provides you with the information you need to get started.
We are currently working on developing different language-based SDKs to speed up development. Still, in the meantime, we have provided you with code examples in some popular languages like PHP, Ruby and Python. We plan on updating this document with examples of other popular languages, such as Go, Node.js, and .NET in the near future.
HTTP Methods
We follow the REST API standards for all our API interactions. Here are the supported methods of communication.
Method | What it does |
---|---|
GET | Used to request data from a specified resource |
POST | Used to send data to an endpoint to create/update a resource |
PUT | Used to send data to an endpoint to create/update a resource. |
DELETE | Used to delete the specified resource. |
Before you get started, ensure that your server supports all these methods. The most common error you will experience when these methods are not supported is the HTTP Forbidden error with the code 403. It usually means the server you are making these API calls from does not support PUT/DELETE operations. You must contact your server administrator or change configurations to execute our APIs without issues.
Authorisation
You can authenticate by sending your API key in a custom header called X-SPZ-PUBLIC-KEY
. Without this, you cannot make any of the API calls.
Data format
You can use the form, x-www-form-URL-encoded, or JSON formats when sending data to our API endpoints. All of them are perfectly acceptable. The return format is, by default JSON.
Available SDKs
We have developed several software development kits (SDK) available based on your preferred programming language. However, if there is a language for which you do not see an SDK, don’t hesitate to contact our team, and we can look into creating one for you.
PHP
You can download the latest version of the code via the GitHub repository, or you can install it via composer as follows:
composer require spotzee-marketing/spotzee-php
You can then follow the instructions from the examples/setup.php
file.
Python
You can download the latest version of the code via the GitHub repository, or you can install it via pip as follows:
pip install spotzee-python
You can then follow the instructions from the examples/setup_api.py
file.
Ruby
You can download the latest version of the code via the GitHub repository. Before you execute the command below, ensure you have Ruby installed on your computer/server.
git clone https://github.com/spotzee-marketing/spotzee-ruby.git
You would need excon
gem for SDK to work correctly. You can install this gem by using the following command: sudo gem install excon
. You can then follow the instructions from the examples/setup_api.rb
file.
Configuration
Please make sure to replace
API-KEY
with a valid API key.
https://cp.spotzee.marketing/api/
//Require the autoloader class if you haven't used composer to install the package
require_once __DIR__ . '/../vendor/autoload.php';
//Configuration object (Get your API info from your account -> API keys) :
$config = new \SpotzeeApi\Config([
'apiUrl' => 'https://cp.spotzee.marketing/api/',
'apiKey' => 'API-KEY',
// components
'components' => [
'cache' => [
'class' => \SpotzeeApi\Cache\File::class,
'filesPath' => __DIR__ . '/data/cache', // make sure it is writable by webserver
]
],
]);
//Now inject the configuration and we are ready to make api calls
\SpotzeeApi\Base::setConfig($config);
//Start UTC
date_default_timezone_set('UTC');
require '../spotzee/spotzee'
include Spotzee
include Endpoint
# noinspection SpellCheckingInspection
config = Config.new({
'public_key': 'API-KEY',
'charset': 'utf-8'
})
# now inject the configuration and we are ready to make api calls
Base.config = config
from spotzee.base import Base
from spotzee.config import Config
def setup():
# configuration object
config = Config({
'public_key': 'API-KEY',
'charset': 'utf-8'
})
# now inject the configuration and we are ready to make api calls
Base.set_config(config)
See the language tab on the right for instructions on configuration.
API Endpoint
Use this URL to connect to any endpoints in this documentation:
https://cp.spotzee.marketing/api/
Components
When you make GET
requests, our API returns proper etags. We use this to cache the request to decrease the load on our servers and improve performance on the client side. You must use the cache components to store the responses (via file cache). For more information on this, please see SpotzeeApi\Cache
for a list of available cache components and their usage.
Status
Get the status rollup for the whole Spotzee services. This endpoint /status
includes an indicator - one of none, minor, major, or critical, as well as a human description of the blended component status. Examples of the blended status include “All Systems Operational”, “Partial System Outage”, and “Major Service Outage”. Full API url would be https://cp.spotzee.marketing/api/status
.
Lists
Lists endpoint
Not applicable
/ CREATE THE ENDPOINT
$endpoint = new SpotzeeApi\Endpoint\Lists();
# CREATE THE ENDPOINT
endpoint = Lists.new
from spotzee.endpoint.lists import Lists
"""
CREATE THE ENDPOINT
"""
endpoint = Lists()
Get all lists
curl --location 'https://cp.spotzee.marketing/api/lists?pageNumber=1&perPage=10' \
--header 'X-SPZ-PUBLIC-KEY: API-KEY'
// GET ALL ITEMS
$response = $endpoint->getLists($pageNumber = 1, $perPage = 10);
// DISPLAY RESPONSE
echo '<pre>';
print_r($response->body);
echo '</pre>';
# GET ALL ITEMS
response = endpoint.get_lists(page = 1, per_page = 10)
# DISPLAY RESPONSE
puts response.body
"""
GET ALL ITEMS
"""
response = endpointLists.get_lists(page=1, per_page=10)
"""
DISPLAY RESPONSE
"""
print(response.content)
The above command returns an object structured like this JSON:
{
"status": "success",
"data": {
"count": "12",
"total_pages": 2,
"current_page": 1,
"next_page": 2,
"prev_page": null,
"records": [
{
"general": {
"list_uid": "tz601yx7aa61b",
"name": "Testing list #4",
"display_name": "Testing list",
"description": "Testing list"
},
"defaults": {
"from_name": "Test user",
"reply_to": "user@example.com",
"subject": ""
},
"notifications": {
"subscribe": "no",
"unsubscribe": "no",
"subscribe_to": "",
"unsubscribe_to": ""
},
"company": {
"name": "Support",
"address_1": "Test",
"address_2": "",
"zone_name": "Constanta",
"city": "Constanta",
"zip_code": "1234x",
"phone": "",
"address_format": "[COMPANY_NAME]\n[COMPANY_ADDRESS_1] [COMPANY_ADDRESS_2]\n[COMPANY_CITY] [COMPANY_ZONE] [COMPANY_ZIP]\n[COMPANY_COUNTRY]\n[COMPANY_WEBSITE]",
"country": {
"country_id": "1",
"name": "Afghanistan",
"code": "AF"
}
}
},
{
"general": {
"list_uid": "zh103m6twfcd2",
"name": "Testing list #5",
"display_name": "Testing list",
"description": "Testing list"
},
"defaults": {
"from_name": "Test user",
"reply_to": "user@example.com",
"subject": ""
},
"notifications": {
"subscribe": "no",
"unsubscribe": "no",
"subscribe_to": "",
"unsubscribe_to": ""
},
"company": {
"name": "Support",
"address_1": "Test",
"address_2": "",
"zone_name": "Constanta",
"city": "Constanta",
"zip_code": "1234x",
"phone": "",
"address_format": "[COMPANY_NAME]\n[COMPANY_ADDRESS_1] [COMPANY_ADDRESS_2]\n[COMPANY_CITY] [COMPANY_ZONE] [COMPANY_ZIP]\n[COMPANY_COUNTRY]\n[COMPANY_WEBSITE]",
"country": {
"country_id": "1",
"name": "Afghanistan",
"code": "AF"
}
}
}
]
}
}
This endpoint retrieves all the lists.
HTTP Request
GET https://cp.spotzee.marketing/api/lists
Query Parameters
Parameter | Default | Description |
---|---|---|
pageNumber | 1 | Current page to retrieve. |
perPage | 10 | Items per page to retrieve. |
Get one list
curl --location 'https://cp.spotzee.marketing/api/lists/LIST-UNIQUE-ID' \
--header 'X-SPZ-PUBLIC-KEY: API-KEY'
// get a single list
$response = $endpoint->getList('LIST-UNIQUE-ID');
// DISPLAY RESPONSE
echo '<hr /><pre>';
print_r($response->body);
echo '</pre>';
# GET ONE ITEM
response = endpoint.get_list('LIST-UNIQUE-ID')
# DISPLAY RESPONSE
puts response.body
"""
GET ONE ITEM
"""
response = endpointLists.get_list('LIST-UNIQUE-ID')
"""
DISPLAY RESPONSE
"""
print(response.content)
The above command returns an object structured like this JSON:
{
"status": "success",
"data": {
"record": {
"general": {
"list_uid": "cn417nrhmv922",
"name": "Testing list #4",
"display_name": "Testing list",
"description": "Testing list"
},
"defaults": {
"from_email": "from@domain.com",
"from_name": "User Test",
"reply_to": "user@example.com",
"subject": ""
},
"notifications": {
"subscribe": "no",
"unsubscribe": "no",
"subscribe_to": "",
"unsubscribe_to": ""
},
"company": {
"name": "Support",
"address_1": "Test",
"address_2": "",
"zone_name": "Constanta",
"city": "Constanta",
"zip_code": "1234x",
"phone": "",
"address_format": "[COMPANY_NAME]\n[COMPANY_ADDRESS_1] [COMPANY_ADDRESS_2]\n[COMPANY_CITY] [COMPANY_ZONE] [COMPANY_ZIP]\n[COMPANY_COUNTRY]\n[COMPANY_WEBSITE]",
"country": {
"country_id": "1",
"name": "Afghanistan",
"code": "AF"
}
}
}
}
}
This endpoint retrieves the list with the given LIST-UNIQUE-ID
.
HTTP Request
GET https://cp.spotzee.marketing/api/lists/LIST-UNIQUE-ID
URL Segments
Segment | Required | Description |
---|---|---|
LIST-UNIQUE-ID | yes | List unique id which to retrieve. |
Create a list
curl --location 'https://cp.spotzee.marketing/api/lists' \
--header 'X-SPZ-PUBLIC-KEY: API-KEY' \
--form 'general[name]="My list created from the API"' \
--form 'general[description]="This is a test list, created from the API."' \
--form 'defaults[from_name]="John Doe"' \
--form 'defaults[from_email]="johndoe@doe.com"' \
--form 'defaults[reply_to]="johndoe@doe.com"' \
--form 'defaults[subject]="Hello!"' \
--form 'notifications[subscribe]="yes"' \
--form 'notifications[unsubscribe]="yes"' \
--form 'notifications[subscribe_to]="johndoe@doe.com"' \
--form 'notifications[unsubscribe_to]="johndoe@doe.com"' \
--form 'company[name]="John Doe INC"' \
--form 'company[country]="United States"' \
--form 'company[zone]="New York"' \
--form 'company[address_1]="Some street address"' \
--form 'company[address_2]=""' \
--form 'company[zone_name]=""' \
--form 'company[city]="New York City"' \
--form 'company[zip_code]="10019"'
// create a new list
// please see countries.php example file for a list of allowed countries/zones for list company
$response = $endpoint->create([
// required
'general' => [
'name' => 'My list created from the API', // required
'description' => 'This is a test list, created from the API.', // required
],
// required
'defaults' => [
'from_name' => 'John Doe', // required
'from_email'=> 'johndoe@doe.com', // required
'reply_to' => 'johndoe@doe.com', // required
'subject' => 'Hello!',
],
// optional
'notifications' => [
// notification when new subscriber added
'subscribe' => 'yes', // yes|no
// notification when subscriber unsubscribes
'unsubscribe' => 'yes', // yes|no
// where to send the notifications.
'subscribe_to' => 'johndoe@doe.com',
'unsubscribe_to' => 'johndoe@doe.com',
],
// optional, if not set customer company data will be used
'company' => [
'name' => 'John Doe INC', // required
'country' => 'United States', // required
'zone' => 'New York', // required
'address_1' => 'Some street address', // required
'address_2' => '',
'zone_name' => '', // when country doesn't have required zone.
'city' => 'New York City',
'zip_code' => '10019',
],
]);
// and get the response
echo '<pre>';
print_r($response->body);
echo '</pre>';
# CREATE ONE LIST
response = endpoint.create({
# required
'general': {
'name': 'My list created from the API', # required
'description': 'This is a test list, created from the API.', # required
},
'defaults': {
'from_name': 'John Doe', # required
'from_email': 'johndoe@doe.com', # required
'reply_to': 'johndoe@doe.com', # required
'subject': 'Hello!',
}
})
# DISPLAY RESPONSE
puts response.body
"""
CREATE ONE LIST
"""
response = endpointLists.create({
# required
'general': {
'name': 'My list created from the API', # required
'description': 'This is a test list, created from the API.', # required
},
'defaults': {
'from_name': 'John Doe', # required
'from_email': 'johndoe@doe.com', # required
'reply_to': 'johndoe@doe.com', # required
'subject': 'Hello!',
}
})
"""
DISPLAY RESPONSE
"""
print(response.content)
The above command returns an object structured like this JSON:
{
"status":"success",
"list_uid": "hv4163y076d84"
}
This endpoint creates a list.
The $data
param can contain the following indexed arrays:
- general -
required
- defaults -
required
- notifications -
optional
- company -
optional
, if not set customer company data will be used
Please see the “countries.php” example file for a list of allowed countries/zones for a list of company.
HTTP Request
POST https://cp.spotzee.marketing/api/lists
POST Parameters
Parameter | Type | Required | Description |
---|---|---|---|
data | array | yes | Array with the list details. The following indexed arrays are accepted: general, defaults, notifications, company |
General block - required
Parameter | Type | Required | Description |
---|---|---|---|
name | string | yes | List name |
description | string | yes | List description |
Defaults block - required
Parameter | Type | Required | Description |
---|---|---|---|
from_name | string | yes | From name |
from_email | string | yes | From email |
reply_to | string | yes | Reply to email |
subject | string | no | List subject |
Notifications block - optional
Parameter | Type | Required | Description |
---|---|---|---|
subscribe | Yes/No | no | Notification when new subscriber added |
unsubscribe | Yes/No | no | Notification when new subscriber unsubscribe |
subscribe_to | string | no | Where to send the notifications on subscribe |
unsubscribe_to | string | no | Where to send the notifications on unsubscribe |
Company block - optional - if not set customer company data will be used
Parameter | Type | Required | Description |
---|---|---|---|
name | string | yes | Company name |
country | string | yes | Company country |
zone | string | yes | Company zone |
address_1 | string | yes | Company address |
address_2 | string | no | Company address 2 |
zone_name | string | no | Company address - when country doesn’t have required zone. |
city | string | no | Company city |
zipcode | string | no | Company zipcode |
Update a list
curl --location --request PUT 'https://cp.spotzee.marketing/api/lists/LIST-UNIQUE-ID' \
--header 'X-SPZ-PUBLIC-KEY: API-KEY' \
--form 'general[name]="My list created from the API - now updated!"' \
--form 'general[description]="This is a test list, created from the API."' \
--form 'defaults[from_name]="John Doe"' \
--form 'defaults[from_email]="johndoe@doe.com"' \
--form 'defaults[reply_to]="johndoe@doe.com"' \
--form 'defaults[subject]="Hello!"' \
--form 'notifications[subscribe]="yes"' \
--form 'notifications[unsubscribe]="yes"' \
--form 'notifications[subscribe_to]="johndoe@doe.com"' \
--form 'notifications[unsubscribe_to]="johndoe@doe.com"' \
--form 'company[name]="John Doe INC"' \
--form 'company[country]="United States"' \
--form 'company[zone]="New York"' \
--form 'company[address_1]="Some street address"' \
--form 'company[address_2]=""' \
--form 'company[zone_name]=""' \
--form 'company[city]="New York City"' \
--form 'company[zip_code]="10019"'
// update list
// please see countries.php example file for a list of allowed countries/zones for list company
$response = $endpoint->update('LIST-UNIQUE-ID', [
// required
'general' => [
'name' => 'My list created from the API - now updated!', // required
'description' => 'This is a test list, created from the API.', // required
],
// required
'defaults' => [
'from_name' => 'John Doe', // required
'from_email'=> 'johndoe@doe.com', // required
'reply_to' => 'johndoe@doe.com', // required
'subject' => 'Hello!',
],
// optional
'notifications' => [
// notification when new subscriber added
'subscribe' => 'yes', // yes|no
// notification when subscriber unsubscribes
'unsubscribe' => 'yes', // yes|no
// where to send the notifications.
'subscribe_to' => 'johndoe@doe.com',
'unsubscribe_to' => 'johndoe@doe.com',
],
// optional, if not set customer company data will be used
'company' => [
'name' => 'John Doe INC', // required
'country' => 'United States', // required
'zone' => 'New York', // required
'address_1' => 'Some street address', // required
'address_2' => '',
'zone_name' => '',
'city' => 'New York City',
'zip_code' => '10019',
],
]);
// and get the response
echo '<pre>';
print_r($response->body);
echo '</pre>';
# UPDATE ONE LIST
response = endpoint.update('LIST-UNIQUE-ID', {
# required
'general': {
'name': 'My list created from the API and now updated', # required
'description': 'This is a test list, created from the API.', # required
},
'defaults': {
'from_name': 'John Doe', # required
'from_email': 'johndoe@doe.com', # required
'reply_to': 'johndoe@doe.com', # required
'subject': 'Hello!',
}
})
# DISPLAY RESPONSE
puts response.body
"""
UPDATE ONE LIST
"""
response = endpointLists.update('LIST-UNIQUE-ID', {
# required
'general': {
'name': 'My list created from the API and now updated', # required
'description': 'This is a test list, created from the API.', # required
},
'defaults': {
'from_name': 'John Doe', # required
'from_email': 'johndoe@doe.com', # required
'reply_to': 'johndoe@doe.com', # required
'subject': 'Hello!',
}
})
"""
DISPLAY RESPONSE
"""
print(response.content)
The above command returns an object structured like this JSON:
{
"status":"success"
}
This endpoint updates a list.
HTTP Request
PUT https://cp.spotzee.marketing/api/lists/LIST-UNIQUE-ID
URL Segment
Segment | Type | Required | Description |
---|---|---|---|
LIST-UNIQUE-ID | string | yes | List unique identifier |
POST Parameters
Parameter | Type | Required | Description |
---|---|---|---|
data | array | yes | Array with the list details. The following indexed arrays are accepted: general, defaults, notifications, company. See the create section for details |
Copy a list
curl --location --request POST 'https://cp.spotzee.marketing/api/lists/LIST-UNIQUE-ID/copy' \
--header 'X-SPZ-PUBLIC-KEY: API-KEY'
// copy a list
$response = $endpoint->copy('LIST-UNIQUE-ID');
// DISPLAY RESPONSE
echo '<hr /><pre>';
print_r($response->body);
echo '</pre>';
# COPY A LIST
response = endpoint.copy('LIST-UNIQUE-ID')
# DISPLAY RESPONSE
puts response.body
"""
COPY A LIST
"""
response = endpointLists.copy('LIST-UNIQUE-ID')
"""
DISPLAY RESPONSE
"""
print(response.content)
The above command returns an object structured like this JSON:
{
"status":"success",
"list_uid": "hv4163y076d84"
}
This endpoint copy the list with the given LIST-UNIQUE-ID
.
HTTP Request
POST https://cp.spotzee.marketing/api/lists/LIST-UNIQUE-ID/copy
URL Segments
Segment | Required | Description |
---|---|---|
LIST-UNIQUE-ID | yes | List unique id to copy. |
Delete a list
curl --location --request DELETE 'https://cp.spotzee.marketing/api/lists/LIST-UNIQUE-ID/copy' \
--header 'X-SPZ-PUBLIC-KEY: API-KEY'
// delete a list
$response = $endpoint->delete('LIST-UNIQUE-ID');
// DISPLAY RESPONSE
echo '<hr /><pre>';
print_r($response->body);
echo '</pre>';
# DELETE A LIST
response = endpoint.delete('LIST-UNIQUE-ID')
# DISPLAY RESPONSE
puts response.body
"""
DELETE A LIST
"""
response = endpointLists.delete('LIST-UNIQUE-ID')
"""
DISPLAY RESPONSE
"""
print(response.content)
The above command returns an object structured like this JSON:
{
"status":"success"
}
This endpoint will delete the list with the given LIST-UNIQUE-ID
.
HTTP Request
DELETE https://cp.spotzee.marketing/api/lists/LIST-UNIQUE-ID
URL Segments
Segment | Required | Description |
---|---|---|
LIST-UNIQUE-ID | yes | List unique id to delete. |
Fields
List fields endpoint
Not applicable
// CREATE THE ENDPOINT
$endpoint = new SpotzeeApi\Endpoint\ListFields();
# CREATE THE ENDPOINT
endpoint = ListFields.new
from spotzee.endpoint.list_fields import ListFields
"""
CREATE THE ENDPOINT
"""
endpoint = ListFields()
Get all list fields
curl --location 'https://cp.spotzee.marketing/api/lists/LIST-UNIQUE-ID/fields?pageNumber=1&perPage=10' \
--header 'X-SPZ-PUBLIC-KEY: API-KEY'
// GET ALL ITEMS
$response = $endpoint->getFields('LIST-UNIQUE-ID');
// DISPLAY RESPONSE
echo '<pre>';
print_r($response->body);
echo '</pre>';
# GET ALL FIELDS OF A LIST
response = endpoint.get_fields('LIST_UID')
# DISPLAY RESPONSE
puts response.body
"""
GET ALL FIELDS OF A LIST
"""
response = endpoint.get_fields(list_uid='LIST_UID')
"""
DISPLAY RESPONSE
"""
print(response.content)
The above command returns an object structured like this JSON:
{
"status": "success",
"data": {
"records": [
{
"tag": "EMAIL",
"label": "Email",
"required": "yes",
"help_text": null,
"type": {
"name": "Text",
"identifier": "text",
"description": "Text"
}
},
{
"tag": "FNAME",
"label": "First name",
"required": "no",
"help_text": null,
"type": {
"name": "Text",
"identifier": "text",
"description": "Text"
}
},
{
"tag": "LNAME",
"label": "Last name",
"required": "no",
"help_text": null,
"type": {
"name": "Text",
"identifier": "text",
"description": "Text"
}
}
]
}
}
This endpoint retrieves all the fields of a list.
HTTP Request
GET https://cp.spotzee.marketing/api/lists/LIST-UNIQUE-ID/fields
URL Segments
Segment | Required | Description |
---|---|---|
LIST-UNIQUE-ID | yes | The list unique identifier |
Query Parameters
Parameter | Default | Description |
---|---|---|
pageNumber | 1 | Current page to retrieve. |
perPage | 10 | Items per page to retrieve. |
Segments
List segments endpoint
Not applicable
// CREATE THE ENDPOINT
$endpoint = new SpotzeeApi\Endpoint\ListSegments();
# CREATE THE ENDPOINT
endpoint = ListSegments.new
from spotzee.endpoint.list_segments import ListSegments
"""
CREATE THE ENDPOINT
"""
endpoint = ListSegments()
Get all list segments
curl --location 'https://cp.spotzee.marketing/api/lists/LIST-UNIQUE-ID/segments?pageNumber=1&perPage=10' \
--header 'X-SPZ-PUBLIC-KEY: API-KEY'
// GET ALL ITEMS
$response = $endpoint->getSegments('LIST-UNIQUE-ID');
// DISPLAY RESPONSE
echo '<pre>';
print_r($response->body);
echo '</pre>';
# GET ALL SEGMENTS OF A LIST
response = endpoint.get_segments('LIST_UID')
# DISPLAY RESPONSE
puts response.body
"""
GET ALL SEGMENTS OF A LIST
"""
response = endpoint.get_segments(list_uid='LIST_UID')
"""
DISPLAY RESPONSE
"""
print(response.content)
The above command returns an object structured like this JSON:
{
"status": "success",
"data": {
"count": "1",
"total_pages": 1,
"current_page": 1,
"next_page": null,
"prev_page": null,
"records": [
{
"segment_uid": "yx536w32xt946",
"name": "test",
"subscribers_count": 289
}
]
}
}
This endpoint retrieves all the segments of a list.
HTTP Request
GET https://cp.spotzee.marketing/api/lists/LIST-UNIQUE-ID/segments
URL Segments
Segment | Required | Description |
---|---|---|
LIST-UNIQUE-ID | yes | The list unique identifier |
Query Parameters
Parameter | Default | Description |
---|---|---|
pageNumber | 1 | Current page to retrieve. |
perPage | 10 | Items per page to retrieve. |
Subscribers
Subscribers endpoint
Not applicable
/ CREATE THE ENDPOINT
$endpoint = new SpotzeeApi\Endpoint\ListSubscribers();
# CREATE THE ENDPOINT
endpoint = ListSubscribers.new
from spotzee.endpoint.list_subscribers import ListSubscribers
"""
CREATE THE ENDPOINT
"""
endpoint = ListSubscribers()
Get all subscribers
curl --location 'https://cp.spotzee.marketing/api/lists/LIST-UNIQUE-ID/subscribers?pageNumber=1&perPage=10' \
--header 'X-SPZ-PUBLIC-KEY: API-KEY'
// GET ALL ITEMS
$response = $endpoint->getSubscribers('LIST-UNIQUE-ID', $pageNumber = 1, $perPage = 10);
// DISPLAY RESPONSE
echo '<pre>';
print_r($response->body);
echo '</pre>';
# GET ALL SUBSCRIBERS OF A LIST
response = endpoint.get_subscribers(list_uid = 'LIST-UNIQUE-ID', page = 1, per_page = 10)
# DISPLAY RESPONSE
puts response.body
"""
GET ALL SUBSCRIBERS OF A LIST
"""
response = endpoint.get_subscribers(list_uid='LIST-UNIQUE-ID', page=1, per_page=10)
"""
DISPLAY RESPONSE
"""
print(response.content)
The above command returns an object structured like this JSON:
{
"status": "success",
"data": {
"count": "13",
"total_pages": 2,
"current_page": 1,
"next_page": 2,
"prev_page": null,
"records": [
{
"subscriber_uid": "ll381bxshm01e",
"EMAIL": "dmacmeartyd@jugem.jp",
"FNAME": "",
"LNAME": "",
"status": "unsubscribed",
"source": "import",
"ip_address": "",
"date_added": "2021-02-20 17:26:18"
},
{
"subscriber_uid": "tl269bw0ol42e",
"EMAIL": "gsteblesc@hp.com",
"FNAME": "",
"LNAME": "",
"status": "unsubscribed",
"source": "import",
"ip_address": "",
"date_added": "2021-02-20 17:26:18"
},
{
"subscriber_uid": "gs870cmwgve71",
"EMAIL": "lruterb@prlog.org",
"FNAME": "",
"LNAME": "",
"status": "unsubscribed",
"source": "import",
"ip_address": "",
"date_added": "2021-02-20 17:26:17"
},
{
"subscriber_uid": "nz753vyrm0f86",
"EMAIL": "kwheildona@tmall.com",
"FNAME": "",
"LNAME": "",
"status": "confirmed",
"source": "import",
"ip_address": "",
"date_added": "2021-02-20 17:26:17"
},
{
"subscriber_uid": "sf449a4k7n193",
"EMAIL": "dshorrock9@hp.com",
"FNAME": "",
"LNAME": "",
"status": "confirmed",
"source": "import",
"ip_address": "",
"date_added": "2021-02-20 17:26:16"
},
{
"subscriber_uid": "op6219zx1s149",
"EMAIL": "slorenz8@drupal.org",
"FNAME": "",
"LNAME": "",
"status": "confirmed",
"source": "import",
"ip_address": "",
"date_added": "2021-02-20 17:26:16"
},
{
"subscriber_uid": "zz449poqsr2af",
"EMAIL": "mhanlon7@wikispaces.com",
"FNAME": "",
"LNAME": "",
"status": "confirmed",
"source": "import",
"ip_address": "",
"date_added": "2021-02-20 17:26:16"
},
{
"subscriber_uid": "jl349100yda86",
"EMAIL": "elacroutz6@youku.com",
"FNAME": "",
"LNAME": "",
"status": "confirmed",
"source": "import",
"ip_address": "",
"date_added": "2021-02-20 17:26:15"
},
{
"subscriber_uid": "kw647a5n8l516",
"EMAIL": "mstephenson5@trellian.com",
"FNAME": "",
"LNAME": "",
"status": "confirmed",
"source": "import",
"ip_address": "",
"date_added": "2021-02-20 17:26:15"
},
{
"subscriber_uid": "vo155s4b0d0ad",
"EMAIL": "ldefew4@dailymail.co.uk",
"FNAME": "",
"LNAME": "",
"status": "confirmed",
"source": "import",
"ip_address": "",
"date_added": "2021-02-20 17:26:14"
}
]
}
}
This endpoint retrieves all the subscribers of a list.
HTTP Request
GET https://cp.spotzee.marketing/api/lists/LIST-UNIQUE-ID/subscribers
URL Segments
Segment | Required | Description |
---|---|---|
LIST-UNIQUE-ID | yes | The list unique identifier for which we retrieve the subscribers |
Query Parameters
Parameter | Default | Description |
---|---|---|
pageNumber | 1 | Current page to retrieve. |
perPage | 10 | Items per page to retrieve. |
Get one subscriber
curl --location 'https://cp.spotzee.marketing/api/lists/LIST-UNIQUE-ID/subscribers/SUBSCRIBER-UNIQUE-ID' \
--header 'X-SPZ-PUBLIC-KEY: API-KEY'
// GET ONE ITEM
$response = $endpoint->getSubscriber('LIST-UNIQUE-ID', 'SUBSCRIBER-UNIQUE-ID');
// DISPLAY RESPONSE
echo '<hr /><pre>';
print_r($response->body);
echo '</pre>';
# GET ONE SUBSCRIBER FROM A LIST
response = endpoint.get_subscriber(list_uid = 'LIST-UNIQUE-ID', subscriber_uid = 'SUBSCRIBER-UNIQUE_ID')
# DISPLAY RESPONSE
puts response.body
"""
GET ONE SUBSCRIBER FROM A LIST
"""
response = endpoint.get_subscriber(list_uid='LIST-UNIQUE-ID', subscriber_uid='SUBSCRIBER-UNIQUE_ID')
"""
DISPLAY RESPONSE
"""
print(response.content)
The above command returns an object structured like this JSON:
{
"status": "success",
"data": {
"subscriber_uid": "ll381bxshm01e",
"EMAIL": "dmacmeartyd@jugem.jp",
"FNAME": "",
"LNAME": "",
"status": "unsubscribed",
"source": "import",
"ip_address": "",
"date_added": "2021-02-20 17:26:18"
}
}
This endpoint retrieves the subscriber with the given SUBSCRIBER-UNIQUE-ID
from the given LIST-UNIQUE-ID
.
HTTP Request
GET https://cp.spotzee.marketing/api/lists/LIST-UNIQUE-ID/subscribers/SUBSCRIBER-UNIQUE-ID
URL Segments
Segment | Required | Description |
---|---|---|
LIST-UNIQUE-ID | yes | List unique id to which the subscriber to retrieve belongs. |
SUBSCRIBER-UNIQUE-ID | yes | Subscriber unique id to retrieve. |
Search by email
curl --location 'https://cp.spotzee.marketing/api/lists/LIST-UNIQUE-ID/subscribers/search-by-email?EMAIL=john.doe%40doe.com' \
--header 'X-SPZ-PUBLIC-KEY: API-KEY'
// SEARCH BY EMAIL
$response = $endpoint->emailSearch('LIST-UNIQUE-ID', 'john.doe@doe.com');
// DISPLAY RESPONSE
echo '<hr /><pre>';
print_r($response->body);
echo '</pre>';
# SEARCH BY EMAIL
response = endpoint.email_search(list_uid = 'LIST-UNIQUE-ID', email_address = 'john.doe@example.com')
# DISPLAY RESPONSE
puts response.body
"""
SEARCH BY EMAIL
"""
response = endpoint.email_search(list_uid='LIST-UNIQUE-ID', email_address='john.doe@example.com')
"""
DISPLAY RESPONSE
"""
print(response.content)
The above command returns an object structured like this JSON:
{
"status": "success",
"data": {
"subscriber_uid": "sf449a4k7n193",
"status": "confirmed",
"date_added": "2021-02-20 17:26:16"
}
}
This endpoint searches a subscriber by his email within the list having the LIST-UNIQUE-ID
.
HTTP Request
GET https://cp.spotzee.marketing/api/lists/LIST-UNIQUE-ID/subscribers/search-by-email
URL Segments
Segment | Required | Description |
---|---|---|
LIST-UNIQUE-ID | yes | List unique id to which the subscriber to retrieve belongs. |
Query Parameters
Parameter | Required | Description |
---|---|---|
yes | Subscriber email to retrieve. |
Search by email in all lists
curl --location 'https://cp.spotzee.marketing/api/lists/subscribers/search-by-email-in-all-lists?EMAIL=john.doe%40doe.com' \
--header 'X-SPZ-PUBLIC-KEY: API-KEY'
// SEARCH BY EMAIL IN ALL LISTS
$response = $endpoint->emailSearchAllLists('john.doe@doe.com');
// DISPLAY RESPONSE
echo '<hr /><pre>';
print_r($response->body);
echo '</pre>';
# SEARCH BY EMAIL IN ALL LISTS
response = endpoint.email_search_all_lists(email_address = 'john.doe@example.com')
# DISPLAY RESPONSE
puts response.body
"""
SEARCH BY EMAIL IN ALL LISTS
"""
response = endpoint.email_search_all_lists(email_address='john.doe@example.com')
"""
DISPLAY RESPONSE
"""
print(response.content)
The above command returns an object structured like this JSON:
{
"status": "success",
"data": {
"records": [
{
"subscriber_uid": "sf449a4k7n193",
"email": "dshorrock9@hp.com",
"status": "confirmed",
"source": "import",
"ip_address": "",
"list": {
"list_uid": "cn417nrhmv922",
"display_name": "Testing list",
"name": "Testing list #4"
},
"date_added": "2021-02-20 17:26:16"
}
],
"count": 1,
"current_page": 1,
"next_page": null,
"prev_page": null,
"total_pages": 1
}
}
This endpoint searches a subscriber by his email within all lists.
HTTP Request
GET https://cp.spotzee.marketing/api/lists/subscribers/search-by-email-in-all-lists
Query Parameters
Parameter | Required | Description |
---|---|---|
yes | Subscriber email to retrieve. |
Search by custom fields in a list
curl --location --globoff 'https://cp.spotzee.marketing/api/lists/LIST-UNIQUE-ID/subscribers/search-by-custom-fields?array={%27CUSTOM_FIELD%27%20%3D%3E%20%27VALUE%27}&pageNumber=1&perPage=10' \
--header 'X-SPZ-PUBLIC-KEY: API-KEY'
// SEARCH BY CUSTOM FIELDS IN A LIST
$response = $endpoint->searchByCustomFields('LIST-UNIQUE-ID', [
'EMAIL' => 'john.doe@doe.com'
]);
// DISPLAY RESPONSE
echo '<hr /><pre>';
print_r($response->body);
echo '</pre>';
# SEARCH BY CUSTOM FIELDS IN A LIST
response = endpoint.search_by_custom_fields(list_uid = 'LIST-UNIQUE-ID', fields = {
'EMAIL': 'john.doe@example.com'
}, page = 1, per_page = 10)
"""
SEARCH BY CUSTOM FIELDS IN A LIST
"""
response = endpoint.search_by_custom_fields(list_uid='LIST-UNIQUE-ID', fields={
'EMAIL': 'john.doe@example.com'
}, page=1, per_page=10)
"""
DISPLAY RESPONSE
"""
print(response.content)
The above command returns an object structured like this JSON:
{
"status": "success",
"data": {
"subscriber_uid": "ll381bxshm01e",
"EMAIL": "dmacmeartyd@jugem.jp",
"FNAME": "",
"LNAME": "",
"status": "unsubscribed",
"source": "import",
"ip_address": "",
"date_added": "2021-02-20 17:26:18"
}
}
This endpoint searches a subscriber by his custom field values within a list given by LIST-UNIQUE-ID
.
HTTP Request
GET https://cp.spotzee.marketing/api/lists/LIST-UNIQUE-ID/subscribers/search-by-custom-fields
URL Segments
Segment | Required | Description |
---|---|---|
LIST-UNIQUE-ID | yes | List to search in. |
Query Parameters
Parameter | Required/Default | Description |
---|---|---|
array | yes | Array of custom fields {‘CUSTOM_FIELD’ => ‘VALUE’} |
pageNumber | 1 | Current page to retrieve. |
perPage | 10 | Items per page to retrieve. |
Search by status
curl --location 'https://cp.spotzee.marketing/api/lists/LIST-UNIQUE-ID/subscribers?pageNumber=1&perPage=10&status=active' \
--header 'X-SPZ-PUBLIC-KEY: API-KEY'
// SEARCH BY STATUS
$response = $endpoint->searchByStatus('LIST-UNIQUE-ID', 'confirmed', $pageNumber = 1, $perPage = 10);
// DISPLAY RESPONSE
echo '<hr /><pre>';
print_r($response->body);
echo '</pre>';
# TODO - Implement
"""
TODO - implement
"""
The above command returns an object structured like this JSON:
{
"status": "success",
"data": {
"count": "3",
"total_pages": 1,
"current_page": 1,
"next_page": null,
"prev_page": null,
"records": [
{
"subscriber_uid": "jl349100yda86",
"EMAIL": "elacroutz6@youku.com",
"FNAME": "",
"LNAME": "",
"source": "import",
"status": "confirmed",
"ip_address": "",
"date_added": "2021-02-20 17:26:15"
},
{
"subscriber_uid": "kw647a5n8l516",
"EMAIL": "mstephenson5@trellian.com",
"FNAME": "",
"LNAME": "",
"source": "import",
"status": "confirmed",
"ip_address": "",
"date_added": "2021-02-20 17:26:15"
},
{
"subscriber_uid": "vo155s4b0d0ad",
"EMAIL": "ldefew4@dailymail.co.uk",
"FNAME": "",
"LNAME": "",
"source": "import",
"status": "confirmed",
"ip_address": "",
"date_added": "2021-02-20 17:26:14"
}
]
}
}
This endpoint search for the subscribers having a certain status within the list having the LIST-UNIQUE-ID
.
HTTP Request
GET https://cp.spotzee.marketing/api/lists/LIST-UNIQUE-ID/subscribers
URL Segments
Segment | Required | Description |
---|---|---|
LIST-UNIQUE-ID | yes | The list unique identifier for which we retrieve the subscribers |
Query Parameters
Parameter | Required | Description |
---|---|---|
pageNumber | 1 | Current page to retrieve. |
perPage | 10 | Items per page to retrieve. |
status | yes | Subscribers status to retrieve. |
Get blacklisted subscribers
// Get only the blacklisted subscribers
$response = $endpoint->getBlacklistedSubscribers('LIST-UNIQUE-ID', 'active', $pageNumber = 1, $perPage = 10);
// DISPLAY RESPONSE
echo '<hr /><pre>';
print_r($response->body);
echo '</pre>';
# TODO - Implement
"""
TODO - implement
"""
The above command returns an object structured like this JSON:
{
"status": "success",
"data": {
"count": "3",
"total_pages": 1,
"current_page": 1,
"next_page": null,
"prev_page": null,
"records": [
{
"subscriber_uid": "jl349100yda86",
"EMAIL": "elacroutz6@youku.com",
"FNAME": "",
"LNAME": "",
"source": "import",
"status": "blacklisted",
"ip_address": "",
"date_added": "2021-02-20 17:26:15"
},
{
"subscriber_uid": "kw647a5n8l516",
"EMAIL": "mstephenson5@trellian.com",
"FNAME": "",
"LNAME": "",
"source": "import",
"status": "blacklisted",
"ip_address": "",
"date_added": "2021-02-20 17:26:15"
},
{
"subscriber_uid": "vo155s4b0d0ad",
"EMAIL": "ldefew4@dailymail.co.uk",
"FNAME": "",
"LNAME": "",
"source": "import",
"status": "blacklisted",
"ip_address": "",
"date_added": "2021-02-20 17:26:14"
}
]
}
}
This endpoint returns all the subscribers with the status blacklisted within the list having the LIST-UNIQUE-ID.
HTTP Request
GET https://cp.spotzee.marketing/api/lists/LIST-UNIQUE-ID/subscribers
URL Segments
Segment | Required | Description |
---|---|---|
LIST-UNIQUE-ID | yes | The list unique identifier for which we retrieve the subscribers |
Query Parameters
Parameter | Required | Description |
---|---|---|
pageNumber | 1 | Current page to retrieve. |
perPage | 10 | Items per page to retrieve. |
status | blacklisted | The blacklisted status value. |
Get confirmed subscribers
curl --location 'https://cp.spotzee.marketing/api/lists/LIST-UNIQUE-ID/subscribers?pageNumber=1&perPage=10&status=confirmed' \
--header 'X-SPZ-PUBLIC-KEY: API-KEY'
// GET ALL ITEMS
$response = $endpoint->getConfirmedSubscribers('LIST-UNIQUE-ID', $pageNumber = 1, $perPage = 10);
// DISPLAY RESPONSE
echo '<pre>';
print_r($response->body);
echo '</pre>';
# TODO - Implement
"""
TODO - Implement
"""
The above command returns an object structured like this JSON:
{
"status": "success",
"data": {
"count": "3",
"total_pages": 1,
"current_page": 1,
"next_page": null,
"prev_page": null,
"records": [
{
"subscriber_uid": "jl349100yda86",
"EMAIL": "elacroutz6@youku.com",
"FNAME": "",
"LNAME": "",
"source": "import",
"status": "confirmed",
"ip_address": "",
"date_added": "2021-02-20 17:26:15"
},
{
"subscriber_uid": "kw647a5n8l516",
"EMAIL": "mstephenson5@trellian.com",
"FNAME": "",
"LNAME": "",
"source": "import",
"status": "confirmed",
"ip_address": "",
"date_added": "2021-02-20 17:26:15"
},
{
"subscriber_uid": "vo155s4b0d0ad",
"EMAIL": "ldefew4@dailymail.co.uk",
"FNAME": "",
"LNAME": "",
"source": "import",
"status": "confirmed",
"ip_address": "",
"date_added": "2021-02-20 17:26:14"
}
]
}
}
This endpoint retrieves all the confirmed subscribers of a list.
HTTP Request
GET https://cp.spotzee.marketing/api/lists/LIST-UNIQUE-ID/subscribers
URL Segments
Segment | Required | Description |
---|---|---|
LIST-UNIQUE-ID | yes | The list unique identifier for which we retrieve the subscribers |
Query Parameters
Parameter | Default | Description |
---|---|---|
pageNumber | 1 | Current page to retrieve. |
perPage | 10 | Items per page to retrieve. |
status | confirmed | The confirmed status value |
Get unconfirmed subscribers
curl --location 'https://cp.spotzee.marketing/api/lists/LIST-UNIQUE-ID/subscribers?pageNumber=1&perPage=10&status=unconfirmed' \
--header 'X-SPZ-PUBLIC-KEY: API-KEY'
// GET ALL ITEMS
$response = $endpoint->getUnconfirmedSubscribers('LIST-UNIQUE-ID', $pageNumber = 1, $perPage = 10);
// DISPLAY RESPONSE
echo '<pre>';
print_r($response->body);
echo '</pre>';
# TODO - Implement
"""
TODO - Implement
"""
The above command returns an object structured like this JSON:
{
"status": "success",
"data": {
"count": "3",
"total_pages": 1,
"current_page": 1,
"next_page": null,
"prev_page": null,
"records": [
{
"subscriber_uid": "jl349100yda86",
"EMAIL": "elacroutz6@youku.com",
"FNAME": "",
"LNAME": "",
"source": "import",
"status": "unconfirmed",
"ip_address": "",
"date_added": "2021-02-20 17:26:15"
},
{
"subscriber_uid": "kw647a5n8l516",
"EMAIL": "mstephenson5@trellian.com",
"FNAME": "",
"LNAME": "",
"source": "import",
"status": "unconfirmed",
"ip_address": "",
"date_added": "2021-02-20 17:26:15"
},
{
"subscriber_uid": "vo155s4b0d0ad",
"EMAIL": "ldefew4@dailymail.co.uk",
"FNAME": "",
"LNAME": "",
"source": "import",
"status": "unconfirmed",
"ip_address": "",
"date_added": "2021-02-20 17:26:14"
}
]
}
}
This endpoint retrieves all the unconfirmed subscribers of a list.
HTTP Request
GET https://cp.spotzee.marketing/api/lists/LIST-UNIQUE-ID/subscribers
URL Segments
Segment | Required | Description |
---|---|---|
LIST-UNIQUE-ID | yes | The list unique identifier for which we retrieve the subscribers |
Query Parameters
Parameter | Default | Description |
---|---|---|
pageNumber | 1 | Current page to retrieve. |
perPage | 10 | Items per page to retrieve. |
status | unconfirmed | The unconfirmed status value |
Get unsubscribed subscribers
curl --location 'https://cp.spotzee.marketing/api/lists/LIST-UNIQUE-ID/subscribers?pageNumber=1&perPage=10&status=unsubscribed' \
--header 'X-SPZ-PUBLIC-KEY: API-KEY'
// GET ALL ITEMS
$response = $endpoint->getUnsubscribedSubscribers('LIST-UNIQUE-ID', $pageNumber = 1, $perPage = 10);
// DISPLAY RESPONSE
echo '<pre>';
print_r($response->body);
echo '</pre>';
# TODO - Implement
"""
TODO - Implement
"""
The above command returns an object structured like this JSON:
{
"status": "success",
"data": {
"count": "3",
"total_pages": 1,
"current_page": 1,
"next_page": null,
"prev_page": null,
"records": [
{
"subscriber_uid": "jl349100yda86",
"EMAIL": "elacroutz6@youku.com",
"FNAME": "",
"LNAME": "",
"source": "import",
"status": "unsubscribed",
"ip_address": "",
"date_added": "2021-02-20 17:26:15"
},
{
"subscriber_uid": "kw647a5n8l516",
"EMAIL": "mstephenson5@trellian.com",
"FNAME": "",
"LNAME": "",
"source": "import",
"status": "unsubscribed",
"ip_address": "",
"date_added": "2021-02-20 17:26:15"
},
{
"subscriber_uid": "vo155s4b0d0ad",
"EMAIL": "ldefew4@dailymail.co.uk",
"FNAME": "",
"LNAME": "",
"source": "import",
"status": "unsubscribed",
"ip_address": "",
"date_added": "2021-02-20 17:26:14"
}
]
}
}
This endpoint retrieves all the unsubscribed subscribers of a list.
HTTP Request
GET https://cp.spotzee.marketing/api/lists/LIST-UNIQUE-ID/subscribers
URL Segments
Segment | Required | Description |
---|---|---|
LIST-UNIQUE-ID | yes | The list unique identifier for which we retrieve the subscribers |
Query Parameters
Parameter | Default | Description |
---|---|---|
pageNumber | 1 | Current page to retrieve. |
perPage | 10 | Items per page to retrieve. |
status | unsubscribed | The unsubscribe status value |
Create a subscriber
curl --location 'https://cp.spotzee.marketing/api/lists/LIST-UNIQUE-ID/subscribers' \
--header 'X-SPZ-PUBLIC-KEY: API-KEY' \
--form 'EMAIL="john.doe@doe.com"' \
--form 'PHONE="+12025550145"' \
--form 'FNAME="John"' \
--form 'LNAME="Doe"'
// ADD SUBSCRIBER
$response = $endpoint->create('LIST-UNIQUE-ID', [
'EMAIL' => 'john.doe@doe.com', // the confirmation email will be sent!!! Use valid email address
'FNAME' => 'John',
'LNAME' => 'Doe'
]);
// DISPLAY RESPONSE
echo '<hr /><pre>';
print_r($response->body);
echo '</pre>';
# ADD SUBSCRIBER
response = endpoint.create(list_uid = 'LIST-UNIQUE-ID', data = {
'EMAIL': 'john.doe@example.com', # the confirmation email will be sent!!! Use valid email address
'FNAME': 'John',
'LNAME': 'Doe'
})
"""
ADD SUBSCRIBER
"""
response = endpoint.create(list_uid='LIST-UNIQUE-ID', data={
'EMAIL': 'john.doe@example.com', # the confirmation email will be sent!!! Use valid email address
'FNAME': 'John',
'LNAME': 'Doe'
})
"""
DISPLAY RESPONSE
"""
print(response.content)
The above command returns an object structured like this JSON:
{
"status":"success",
"data": {
"record": {
"subscriber_uid": "bm421c3lwe043",
"email": "john.doe@doe.com",
"ip_address": "5.13.134.200",
"source": "api",
"date_added": {
"expression": "NOW()",
"params": {}
}
}
}
}
This endpoint creates a subscriber
HTTP Request
POST https://cp.spotzee.marketing/api/lists/LIST-UNIQUE-ID/subscribers
URL Segments
Segment | Required | Description |
---|---|---|
LIST-UNIQUE-ID | yes | List unique identifier. |
POST Parameters
Parameter | Type | Required | Description |
---|---|---|---|
data | array | yes | Array with the custom fields {name => value}. The EMAIL key is required. |
Create subscribers in bulk
curl --location 'https://cp.spotzee.marketing/api/lists/LIST-UNIQUE-ID/subscribers' \
--header 'X-SPZ-PUBLIC-KEY: API-KEY' \
--form 'EMAIL="john.doe-1@doe.com"' \
--form 'PHONE="+12025550145"' \
--form 'FNAME="John"' \
--form 'LNAME="Doe"' \
--form 'EMAIL="john.doe-2@doe.com"' \
--form 'PHONE="+12025550146"' \
--form 'FNAME="John"' \
--form 'LNAME="Doe"' \
--form 'EMAIL="john.doe-3@doe.com"' \
--form 'PHONE="+12025550147"' \
--form 'FNAME="John"' \
--form 'LNAME="Doe"'
// ADD SUBSCRIBERS IN BULK
$response = $endpoint->createBulk('LIST-UNIQUE-ID', [
[
'EMAIL' => 'john.doe-1@doe.com',
'FNAME' => 'John',
'LNAME' => 'Doe'
],
[
'EMAIL' => 'john.doe-2@doe.com',
'FNAME' => 'John',
'LNAME' => 'Doe'
],
[
'EMAIL' => 'john.doe-3@doe.com',
'FNAME' => 'John',
'LNAME' => 'Doe'
]
]);
// DISPLAY RESPONSE
echo '<hr /><pre>';
print_r($response->body);
echo '</pre>';
# ADD SUBSCRIBERS IN BULK
response = endpoint.create_bulk(list_uid = 'LIST-UNIQUE-ID', data = [
{
'EMAIL': 'john.doe1111@example.com', # the confirmation email will be sent!!! Use valid email address
'FNAME': 'John111',
'LNAME': 'Doe111'
},
{
'EMAIL': 'john.doe2222@example.com', # the confirmation email will be sent!!! Use valid email address
'FNAME': 'John222',
'LNAME': 'Doe222'
},
{
'EMAIL': 'john.doe3333@example.com', # the confirmation email will be sent!!! Use valid email address
'FNAME': 'John333',
'LNAME': 'Doe333'
},
])
"""
ADD SUBSCRIBERS IN BULK
"""
response = endpoint.create_bulk(list_uid='LIST-UNIQUE-ID', data=[
{
'EMAIL': 'john.doe1@example.com', # the confirmation email will be sent!!! Use valid email address
'FNAME': 'John1',
'LNAME': 'Doe1'
},
{
'EMAIL': 'john.doe2@example.com', # the confirmation email will be sent!!! Use valid email address
'FNAME': 'John2',
'LNAME': 'Doe2'
},
{
'EMAIL': 'john.doe3@example.com', # the confirmation email will be sent!!! Use valid email address
'FNAME': 'John3',
'LNAME': 'Doe3'
},
])
"""
DISPLAY RESPONSE
"""
print(response.content)
The above command returns an object structured like this JSON:
{
"status":"success",
"data": {
"records": [
{
"data": {
"subscriber_uid": "kw647a5n8l516",
"EMAIL": "john.doe1@example.com",
"FNAME": "John1",
"LNAME": "Doe1",
"status": "confirmed",
"source": "import",
"ip_address": "",
"date_added": "2021-02-20 17:26:14"
}
},
{
"data": {
"subscriber_uid": "fy287b32cs054",
"EMAIL": "john.doe1@example.com",
"FNAME": "John2",
"LNAME": "Doe2",
"status": "confirmed",
"source": "import",
"ip_address": "",
"date_added": "2021-02-20 17:26:14"
}
},
{
"data": {
"subscriber_uid": "vo155s4b0d0ad",
"EMAIL": "john.doe3@example.com",
"FNAME": "John3",
"LNAME": "Doe3",
"status": "confirmed",
"source": "import",
"ip_address": "",
"date_added": "2021-02-20 17:26:14"
}
}
]
}
}
This endpoint creates subscribers in bulk
HTTP Request
POST https://cp.spotzee.marketing/api/lists/LIST-UNIQUE-ID/subscribers/bulk
URL Segments
Segment | Required | Description |
---|---|---|
LIST-UNIQUE-ID | yes | List unique identifier. |
POST Parameters
Parameter | Type | Required | Description |
---|---|---|---|
array | string | yes | Array of arrays with the custom fields {name => value}. The EMAIL key is required. |
Update a subscriber
This endpoint updates the subscriber with the given SUBSCRIBER-UNIQUE-ID
from the given list LIST-UNIQUE-ID
.
curl --location --request PUT 'https://cp.spotzee.marketing/api/lists/LIST-UNIQUE-ID/subscribers/SUBSCRIBER-UNIQUE-ID' \
--header 'X-SPZ-PUBLIC-KEY: API-KEY' \
--form 'EMAIL="john.doe@doe.com"' \
--form 'PHONE="+12025550145"' \
--form 'FNAME="John"' \
--form 'LNAME="Doe"'
HTTP Request
PUT https://cp.spotzee.marketing/api/lists/LIST-UNIQUE-ID/subscribers/SUBSCRIBER-UNIQUE-ID
URL Segments
Parameter | Required | Description |
---|---|---|
LIST-UNIQUE-ID | yes | List unique identifier |
SUBSCRIBER-UNIQUE-ID | yes | Subscriber unique identifier |
PUT Parameters
Parameter | Type | Required | Description |
---|---|---|---|
data | array | yes | Array with the custom fields {name => value} to be updated. |
Update a subscriber by email
This endpoint updates the subscriber with the given EMAIL from the given list LIST-UNIQUE-ID
.
curl --location --request PUT 'https://cp.spotzee.marketing/api/lists/LIST-UNIQUE-ID/subscribers/SUBSCRIBER-UNIQUE-ID' \
--header 'X-SPZ-PUBLIC-KEY: API-KEY' \
--form 'EMAIL="john.doe@doe.com"' \
--form 'FNAME="John 1"'
HTTP Request
GET https://cp.spotzee.marketing/api/lists/LIST-UNIQUE-ID/subscribers/search-by-email
PUT https://cp.spotzee.marketing/api/lists/LIST-UNIQUE-ID/subscribers/SUBSCRIBER-UNIQUE-ID
URL Segments
Segment | Required | Description |
---|---|---|
LIST-UNIQUE-ID | yes | List unique identifier |
SUBSCRIBER-UNIQUE-ID | yes | Found subscriber unique identifier |
GET/PUT Parameters
Parameter | Type | Required | Description |
---|---|---|---|
string | yes | Email to be searched | |
data | array | yes | Array with the custom fields {name => value} to be updated. |
Create/Update a subscriber
This endpoint updates the subscriber if exists and created it otherwise, from the given list LIST-UNIQUE-ID
.
curl --location 'https://cp.spotzee.marketing/api/lists/LIST-UNIQUE-ID/subscribers' \
--header 'X-SPZ-PUBLIC-KEY: API-KEY' \
--form 'EMAIL="john.doe4@doe.com"' \
--form 'PHONE="+12025550145"' \
--form 'FNAME="John"' \
--form 'LNAME="Doe"'
HTTP Request
GET https://cp.spotzee.marketing/api/lists/LIST-UNIQUE-ID/subscribers/search-by-email
PUT https://cp.spotzee.marketing/api/lists/LIST-UNIQUE-ID/subscribers/SUBSCRIBER-UNIQUE-ID
POST https://cp.spotzee.marketing/api/lists/LIST-UNIQUE-ID/subscribers
URL Segments
Segment | Required | Description |
---|---|---|
LIST-UNIQUE-ID | yes | List unique identifier |
SUBSCRIBER-UNIQUE-ID | yes | Found subscriber unique identifier |
GET/PUT/POST Parameters
Parameter | Type | Required | Description |
---|---|---|---|
data | array | yes | Array with the custom fields {name => value} to be updated. |
string | yes | Email to be searched |
Unsubscribe a subscriber
curl --location --request PUT 'https://cp.spotzee.marketing/api/lists/LIST-UNIQUE-ID/subscribers/SUBSCRIBER-UNIQUE-ID/unsubscribe' \
--header 'X-SPZ-PUBLIC-KEY: API-KEY'
// UNSUBSCRIBE existing subscriber, no email is sent, unsubscribe is silent
$response = $endpoint->unsubscribe('LIST-UNIQUE-ID', 'SUBSCRIBER-UNIQUE-ID');
// DISPLAY RESPONSE
echo '<hr /><pre>';
print_r($response->body);
echo '</pre>';
# UNSUBSCRIBE existing subscriber, no email is sent, unsubscribe is silent
response = endpoint.unsubscribe(list_uid = 'LIST-UNIQUE-ID', subscriber_uid = 'SUBSCRIBER-UNIQUE-ID')
# DISPLAY RESPONSE
puts response.body
"""
UNSUBSCRIBE existing subscriber, no email is sent, unsubscribe is silent
"""
response = endpoint.unsubscribe(list_uid='LIST-UNIQUE-ID', subscriber_uid='SUBSCRIBER-UNIQUE-ID')
"""
DISPLAY RESPONSE
"""
print(response.content)
The above command returns an object structured like this JSON:
{
"status":"success"
}
This endpoint unsubscribes the subscriber with the given SUBSCRIBER-UNIQUE-ID
from the given LIST-UNIQUE-ID
.
HTTP Request
PUT https://cp.spotzee.marketing/api/lists/LIST-UNIQUE-ID/subscribers/SUBSCRIBER-UNIQUE-ID/unsubscribe
URL Segments
Segment | Required | Description |
---|---|---|
LIST-UNIQUE-ID | yes | List unique id to which the subscriber belongs. |
SUBSCRIBER-UNIQUE-ID | yes | Subscriber unique id to unsubscribe. |
Unsubscribe a subscriber by email address
curl --location --request PUT 'https://cp.spotzee.marketing/api/lists/LIST-UNIQUE-ID/subscribers/SUBSCRIBER-UNIQUE-ID/unsubscribe' \
--header 'X-SPZ-PUBLIC-KEY: API-KEY' \
--form 'EMAIL="john@doe.com"'
// UNSUBSCRIBE existing subscriber by email address, no email is sent, unsubscribe is silent
$response = $endpoint->unsubscribeByEmail('LIST-UNIQUE-ID', 'john@doe.com');
// DISPLAY RESPONSE
echo '<hr /><pre>';
print_r($response->body);
echo '</pre>';
# UNSUBSCRIBE existing subscriber by email address, no email is sent, unsubscribe is silent
response = endpoint.unsubscribe_by_email(list_uid = 'LIST-UNIQUE-ID', email_address = 'john.doe@example.com')
# DISPLAY RESPONSE
puts response.body
"""
UNSUBSCRIBE existing subscriber by email address, no email is sent, unsubscribe is silent
"""
response = endpoint.unsubscribe_by_email(list_uid='LIST-UNIQUE-ID', email_address='john.doe@example.com')
"""
DISPLAY RESPONSE
"""
print(response.content)
The above command returns an object structured like this JSON:
{
"status":"success"
}
This endpoint unsubscribes the subscriber with the given EMAIL from the given LIST-UNIQUE-ID
.
HTTP Request
GET https://cp.spotzee.marketing/api/lists/LIST-UNIQUE-ID/subscribers/search-by-email
PUT https://cp.spotzee.marketing/api/lists/LIST-UNIQUE-ID/subscribers/SUBSCRIBER-UNIQUE-ID/unsubscribe
URL Segments
Segment | Required | Description |
---|---|---|
LIST-UNIQUE-ID | yes | List unique id to which the subscriber belongs. |
SUBSCRIBER-UNIQUE-ID | yes | Subscriber unique id to unsubscribe. |
Query Parameters
Parameter | Required | Description |
---|---|---|
yes | Subscriber email to unsubscribe. |
Unsubscribe a subscriber by email address from all the lists
curl --location --request PUT 'https://cp.spotzee.marketing/api/lists/subscribers/unsubscribe-by-email-from-all-lists' \
--header 'X-SPZ-PUBLIC-KEY: API-KEY' \
--form 'EMAIL="john@doe.com"'
// UNSUBSCRIBE existing subscriber from all lists, no email is sent, unsubscribe is silent
$response = $endpoint->unsubscribeByEmailFromAllLists('john@doe.com');
// DISPLAY RESPONSE
echo '<hr /><pre>';
print_r($response->body);
echo '</pre>';
# UNSUBSCRIBE existing subscriber by email address from all lists, no email is sent, unsubscribe is silent
response = endpoint.unsubscribe_by_email_from_all_lists(email_address = 'john.doe@example.com')
# DISPLAY RESPONSE
puts response.body
"""
UNSUBSCRIBE existing subscriber by email address from all lists, no email is sent, unsubscribe is silent
"""
response = endpoint.unsubscribe_by_email_from_all_lists(email_address='john.doe@example.com')
"""
DISPLAY RESPONSE
"""
print(response.content)
The above command returns an object structured like this JSON:
{
"status":"success"
}
This endpoint unsubscribes the subscriber with the given EMAIL from all the lists.
HTTP Request
PUT https://cp.spotzee.marketing/api/lists/subscribers/unsubscribe-by-email-from-all-lists
PUT Parameters
Parameter | Required | Description |
---|---|---|
yes | Subscriber email to unsubscribe. |
Delete one subscriber
curl --location --request DELETE 'https://cp.spotzee.marketing/api/lists/LIST-UNIQUE-ID/subscribers/SUBSCRIBER-UNIQUE-ID' \
--header 'X-SPZ-PUBLIC-KEY: API-KEY'
// DELETE SUBSCRIBER, no email is sent, delete is silent
$response = $endpoint->delete('LIST-UNIQUE-ID', 'SUBSCRIBER-UNIQUE-ID');
// DISPLAY RESPONSE
echo '<hr /><pre>';
print_r($response->body);
echo '</pre>';
# DELETE SUBSCRIBER, no email is sent, delete is silent
response = endpoint.delete(list_uid = 'LIST-UNIQUE-ID', subscriber_uid = 'SUBSCRIBER-UNIQUE-ID')
# DISPLAY RESPONSE
puts response.body
"""
DELETE SUBSCRIBER, no email is sent, delete is silent
"""
response = endpoint.delete(list_uid='LIST-UNIQUE-ID', subscriber_uid='SUBSCRIBER-UNIQUE-ID')
"""
DISPLAY RESPONSE
"""
print(response.content)
The above command returns an object structured like this JSON:
{
"status":"success"
}
This endpoint deletes the subscriber with the given SUBSCRIBER-UNIQUE-ID
from the given LIST-UNIQUE-ID
.
HTTP Request
DELETE https://cp.spotzee.marketing/api/lists/LIST-UNIQUE-ID/subscribers/SUBSCRIBER-UNIQUE-ID
URL Segments
Segment | Required | Description |
---|---|---|
LIST-UNIQUE-ID | yes | List unique id to which the subscriber belongs. |
SUBSCRIBER-UNIQUE-ID | yes | Subscriber unique id to delete. |
Delete by email
curl --location --request DELETE 'https://cp.spotzee.marketing/api/lists/LIST-UNIQUE-ID/subscribers/SUBSCRIBER-UNIQUE-ID' \
--header 'X-SPZ-PUBLIC-KEY: API-KEY' \
--form 'EMAIL="john@doe.com"'
// DELETE SUBSCRIBER by email address, no email is sent, delete is silent
$response = $endpoint->deleteByEmail('LIST-UNIQUE-ID', 'john@doe.com');
// DISPLAY RESPONSE
echo '<hr /><pre>';
print_r($response->body);
echo '</pre>';
# DELETE SUBSCRIBER by email address, no email is sent, delete is silent
response = endpoint.delete_by_email(list_uid = 'LIST-UNIQUE-ID', email_address = 'john.doe@example.com')
# DISPLAY RESPONSE
puts response.body
"""
DELETE SUBSCRIBER by email address, no email is sent, delete is silent
"""
response = endpoint.delete_by_email(list_uid='LIST-UNIQUE-ID', email_address='john.doe@example.com')
"""
DISPLAY RESPONSE
"""
print(response.content)
The above command returns an object structured like this JSON:
{
"status":"success"
}
This endpoint deletes a subscriber by his email within the list having the LIST-UNIQUE-ID
.
HTTP Request
GET https://cp.spotzee.marketing/api/lists/LIST-UNIQUE-ID/subscribers/search-by-email
DELETE https://cp.spotzee.marketing/api/lists/LIST-UNIQUE-ID/subscribers/SUBSCRIBER-UNIQUE-ID
URL Segments
Segment | Required | Description |
---|---|---|
LIST-UNIQUE-ID | yes | List unique id to which the subscriber belongs. |
SUBSCRIBER-UNIQUE-ID | yes | Subscriber unique id to delete. |
GET Parameters
Parameter | Required | Description |
---|---|---|
yes | Subscriber email to retrieve. |
Email campaigns
Email campaigns endpoint
Not applicable
// CREATE THE ENDPOINT
$endpoint = new SpotzeeApi\Endpoint\Campaigns();
# CREATE THE ENDPOINT
endpoint = Campaigns.new
from datetime import datetime, timedelta
from spotzee.endpoint.campaigns import Campaigns
"""
CREATE THE ENDPOINT
"""
endpoint = Campaigns()
Get all email campaigns
curl --location 'https://cp.spotzee.marketing/api/campaigns?pageNumber=1&perPage=10' \
--header 'X-SPZ-PUBLIC-KEY: API-KEY'
// GET ALL ITEMS
$response = $endpoint->getCampaigns($pageNumber = 1, $perPage = 10);
// DISPLAY RESPONSE
echo "<pre>";
print_r($response->body);
echo "</pre>";
# GET ALL ITEMS
response = endpoint.get_campaigns(page = 1, per_page = 10)
# DISPLAY RESPONSE
puts response.body
"""
GET ALL ITEMS
"""
response = endpoint.get_campaigns(page=1, per_page=10)
"""
DISPLAY RESPONSE
"""
print(response.content)
The above command returns an object structured like this JSON:
[
{
"status": "success",
"data": {
"count": "12",
"total_pages": 2,
"current_page": 1,
"next_page": 2,
"prev_page": null,
"records": [
{
"campaign_uid": "og943e5q6e158",
"name": "My API Campaign UPDATED #3",
"status": "sent",
"group": []
},
{
"campaign_uid": "gp5420ve90f3e",
"name": "My API Campaign UPDATED #2",
"status": "sent",
"group": []
},
{
"campaign_uid": "hv4163y076d84",
"name": "My API Campaign UPDATED #1",
"status": "sent",
"group": []
},
{
"campaign_uid": "xk906nd8fn506",
"name": "My API Campaign UPDATED",
"status": "sent",
"group": []
},
{
"campaign_uid": "eh477yfos0258",
"name": "API campaign #1",
"status": "draft",
"group": []
},
{
"campaign_uid": "db516xtc45237",
"name": "API campaign #2",
"status": "draft",
"group": []
},
{
"campaign_uid": "ld526wjke1ff4",
"name": "API campaign #1",
"status": "draft",
"group": []
},
{
"campaign_uid": "bx831rctawf92",
"name": "API campaign",
"status": "paused",
"group": []
},
{
"campaign_uid": "tk459h475l8ef",
"name": "Test #1",
"status": "sent",
"group": []
},
{
"campaign_uid": "go896lnslz8ae",
"name": "Test",
"status": "sent",
"group": []
}
]
}
}
]
This endpoint retrieves all the campaigns.
HTTP Request
GET https://cp.spotzee.marketing/api/campaigns
Query Parameters
Parameter | Default | Description |
---|---|---|
pageNumber | 1 | Current page to retrieve. |
perPage | 10 | Items per page to retrieve. |
Get one email campaign
curl --location 'https://cp.spotzee.marketing/api/campaigns/CAMPAIGN-UNIQUE-ID' \
--header 'X-SPZ-PUBLIC-KEY: API-KEY'
// GET ONE ITEM
$response = $endpoint->getCampaign('CAMPAIGN-UNIQUE-ID');
// DISPLAY RESPONSE
echo '<pre>';
print_r($response->body);
echo '</pre>';
# GET ONE ITEM
response = endpoint.get_campaign('CAMPAIGN_UID')
# DISPLAY RESPONSE
puts response.body
"""
GET ONE ITEM
"""
response = endpoint.get_campaign('CAMPAIGN_UID')
"""
DISPLAY RESPONSE
"""
print(response.content)
The above command returns an object structured like this JSON:
{
"status": "success",
"data": {
"record": {
"campaign_uid": "og943e5q6e158",
"name": "My API Campaign UPDATED #3",
"type": "regular",
"from_name": "John Doe",
"from_email": "john.doe@doe.com",
"to_name": "[EMAIL]",
"reply_to": "john.doe@doe.com",
"subject": "Hey, i am testing the campaigns via API",
"status": "sent",
"date_added": "2\/24\/21, 11:38 PM",
"send_at": "2\/24\/21, 11:39 PM",
"list": {
"list_uid": "ra5026psrjeb5",
"name": "Testing list",
"subscribers_count": 0
},
"segment": [],
"group": []
}
}
}
This endpoint retrieves the campaign with the given CAMPAIGN-UNIQUE-ID
.
HTTP Request
GET https://cp.spotzee.marketing/api/campaigns/CAMPAIGN-UNIQUE-ID
URL Segments
Segment | Required | Description |
---|---|---|
CAMPAIGN-UNIQUE-ID | yes | Campaign unique id to retrieve. |
Create an email campaign
curl --location 'https://cp.spotzee.marketing/api/campaigns' \
--header 'X-SPZ-PUBLIC-KEY: API-KEY' \
--form 'campaign[name]="My API Campaign"' \
--form 'campaign[type]="regular"' \
--form 'campaign[from_name]="John Doe"' \
--form 'campaign[from_email]="john.doe@doe.com"' \
--form 'campaign[subject]="Hey, i am testing the campaigns via API"' \
--form 'campaign[reply_to]="john.doe@doe.com"' \
--form 'campaign[send_at]="2019-06-04 18:10:05"' \
--form 'campaign[list_uid]="LIST-UNIQUE-ID"' \
--form 'campaign[segment_uid]="SEGMENT-UNIQUE-ID"' \
--form 'options[url_tracking]="no"' \
--form 'options[json_feed]="no"' \
--form 'options[xml_feed]="no"' \
--form 'options[plain_text_email]="yes"' \
--form 'options[email_stats]=""' \
--form 'options[autoresponder_event]="AFTER-SUBSCRIBE"' \
--form 'options[autoresponder_time_unit]="hour"' \
--form 'options[autoresponder_time_value]="1"' \
--form 'options[autoresponder_open_campaign_id]="1"' \
--form 'options[cronjob]="0 0 * * *"' \
--form 'options[cronjob_enabled]="1"' \
--form 'template[archive]=@"/Desktop/template.zip"' \
--form 'template[template_uid]="TEMPLATE-UNIQUE-ID"' \
--form 'template[content]=@"/Desktop/template-example.zip"' \
--form 'template[inline_css]="no"' \
--form 'template[plain_text]=""' \
--form 'template[auto_plain_text]="yes"'
// CREATE CAMPAIGN
$response = $endpoint->create([
'name' => 'My API Campaign', // required
'type' => 'regular', // optional: regular or autoresponder
'from_name' => 'John Doe', // required
'from_email' => 'john.doe@doe.com', // required
'subject' => 'Hey, i am testing the campaigns via API', // required
'reply_to' => 'john.doe@doe.com', // required
'send_at' => date('Y-m-d H:i:s', strtotime('+10 hours')), // required, this will use the timezone which customer selected
'list_uid' => 'LIST-UNIQUE-ID', // required
'segment_uid' => 'SEGMENT-UNIQUE-ID',// optional, only to narrow down
// optional block, defaults are shown
'options' => [
'url_tracking' => 'no', // yes | no
'json_feed' => 'no', // yes | no
'xml_feed' => 'no', // yes | no
'plain_text_email' => 'yes',// yes | no
'email_stats' => null, // a valid email address where we should send the stats after campaign done
// - if autoresponder uncomment bellow:
//'autoresponder_event' => 'AFTER-SUBSCRIBE', // AFTER-SUBSCRIBE or AFTER-CAMPAIGN-OPEN
//'autoresponder_time_unit' => 'hour', // minute, hour, day, week, month, year
//'autoresponder_time_value' => 1, // 1 hour after event
//'autoresponder_open_campaign_id' => 1, // INT id of campaign, only if event is AFTER-CAMPAIGN-OPEN,
// - if this campaign is advanced recurring, you can set a cron job style frequency.
// - please note that this applies only for regular campaigns.
//'cronjob' => '0 0 * * *', // once a day
//'cronjob_enabled' => 1, // 1 or 0
],
// required block, archive or template_uid or content => required.
'template' => [
//'archive' => file_get_contents(__DIR__ . '/template-example.zip'),
//'template_uid' => 'TEMPLATE-UNIQUE-ID',
'content' => file_get_contents(__DIR__ . '/template-example.html'),
'inline_css' => 'no', // yes | no
'plain_text' => null, // leave empty to auto generate
'auto_plain_text' => 'yes', // yes | no
],
]);
// DISPLAY RESPONSE
echo '<hr /><pre>';
print_r($response->body);
echo '</pre>';
# CREATE ONE CAMPAIGN
response = endpoint.create({
'name': 'My API Campaign', # required
'type': 'regular', # optional: regular or autoresponder
'from_name': 'John Doe', # required
'from_email': 'john.doe@doe.com', # required
'subject': 'Hey, i am testing the campaigns via API', # required
'reply_to': 'john.doe@doe.com', # required
#required, this will use the timezone which customer selected
'send_at': Time.now.strftime('%Y-%m-%d %H:%M:%S'),
'list_uid': 'LIST_UID', # required
#'segment_uid' : 'SEGMENT-UNIQUE-ID',# optional, only to narrow down
#optional block, defaults are shown
'options': {
'url_tracking': 'no', # yes | no
'json_feed': 'no', # yes | no
'xml_feed': 'no', # yes | no
'plain_text_email': 'yes', # yes | no
'email_stats': nil, # a valid email address where we should send the stats after campaign done
# - if autoresponder uncomment bellow:
# 'autoresponder_event' : 'AFTER-SUBSCRIBE', # AFTER-SUBSCRIBE or AFTER-CAMPAIGN-OPEN
# 'autoresponder_time_unit' : 'hour', # minute, hour, day, week, month, year
# 'autoresponder_time_value' : 1, # 1 hour after event
# 'autoresponder_open_campaign_id' : 1, # INT id of campaign, only if event is AFTER-CAMPAIGN-OPEN,
# - if this campaign is advanced recurring, you can set a cron job style frequency.
# - please note that this applies only for regular campaigns.
# 'cronjob' : '0 0 * * *', # once a day
# 'cronjob_enabled' : 1, # 1 or 0
},
# required block, archive or template_uid or content : required.
# the templates examples can be found here: Examples
'template': {
# 'archive': File.read('template-example.zip'),
# # 'template_uid': 'template_uid',
'content': File.read('template-example.html'),
'inline_css': 'no', # yes | no
# 'plain_text': nil, # leave empty to auto generate
'auto_plain_text': 'yes', # yes | no
},
})
# DISPLAY RESPONSE
puts response.body
"""
CREATE ONE CAMPAIGN
"""
response = endpoint.create({
'name': 'My API Campaign', # required
'type': 'regular', # optional: regular or autoresponder
'from_name': 'John Doe', # required
'from_email': 'john.doe@doe.com', # required
'subject': 'Hey, i am testing the campaigns via API', # required
'reply_to': 'john.doe@doe.com', # required
'send_at': (datetime.now() + timedelta(hours=10)).strftime('%Y-%m-%d %H:%M:%S'),
# required, this will use the timezone which customer selected
'list_uid': 'LIST_UID', # required
# 'segment_uid' : 'SEGMENT-UNIQUE-ID',# optional, only to narrow down
# optional block, defaults are shown
'options': {
'url_tracking': 'no', # yes | no
'json_feed': 'no', # yes | no
'xml_feed': 'no', # yes | no
'plain_text_email': 'yes', # yes | no
'email_stats': None, # a valid email address where we should send the stats after campaign done
# - if autoresponder uncomment bellow:
# 'autoresponder_event' : 'AFTER-SUBSCRIBE', # AFTER-SUBSCRIBE or AFTER-CAMPAIGN-OPEN
# 'autoresponder_time_unit' : 'hour', # minute, hour, day, week, month, year
# 'autoresponder_time_value' : 1, # 1 hour after event
# 'autoresponder_open_campaign_id' : 1, # INT id of campaign, only if event is AFTER-CAMPAIGN-OPEN,
# - if this campaign is advanced recurring, you can set a cron job style frequency.
# - please note that this applies only for regular campaigns.
# 'cronjob' : '0 0 * * *', # once a day
# 'cronjob_enabled' : 1, # 1 or 0
},
# required block, archive or template_uid or content : required.
# the templates examples can be found here: Examples
'template': {
# 'archive' : open('template-example.zip', 'r').read(),
'template_uid': 'TEMPLATE_UID',
# 'content' : open('template-example.html', 'rb').read(),
'inline_css': 'no', # yes | no
# 'plain_text' : None, # leave empty to auto generate
'auto_plain_text': 'yes', # yes | no
},
})
"""
DISPLAY RESPONSE
"""
print(response.content)
The above command returns an object structured like this JSON:
{
"status":"success",
"campaign_uid": "hv4163y076d84"
}
This endpoint creates a campaign.
HTTP Request
POST https://cp.spotzee.marketing/api/campaigns
POST Parameters
Parameter | Type | Required | Description |
---|---|---|---|
campaign | array | yes | Array with the email details. |
template | array | yes | Array with the template details |
options | array | no | Array with the options details |
Campaign block
Parameter | Type | Required | Description |
---|---|---|---|
name | string | yes | Campaign name. |
type | string | no | Campaign type: regular or autoresponder. Default is regular. |
from_name | string | yes | The campaign from name |
from_email | string | yes | The campaign from email address |
subject | string | yes | The campaign subject |
from_name | string | yes | The subscriber for which we record the bounce |
reply_to | string | yes | The campaign reply to email address |
send_at | datetime (Y-m-d H:i:s) | yes | This will use the timezone which customer selected |
list_uid | string | yes | The list uid to which this campaign will be sent |
segment_uid | string | no | Narrow down the campaign recipients |
template | array | yes | The campaign template object block. Archive or template_uid or content => required |
options | array | no | The campaign optional block, defaults are shown |
Template block
Parameter | Type | Required | Description |
---|---|---|---|
archive | filePath | yes | Template file zip location |
template_uid | string | yes | Template unique id from Spotzee |
content | string | yes | Template content |
inline_css | yes/no | yes | Accept inline css |
plain_text | null/string | no | Send null to autogenerate as default |
auto_plain_text | yes/no | yes | Generate plain text template |
Options block
Parameter | Type | Required | Description |
---|---|---|---|
url_tracking | yes/no | no | Enable/Disable url tracking |
json_feed | yes/no | no | Enable/Disable json feed |
xml_feed | yes/no | no | Enable/Disable xml feed |
plain_text_email | yes/no | no | Enable/Disable the plain text email |
email_stats | string/null | no | A valid email address where the stats will be sent |
autoresponder_event | string | no | Possible values: AFTER-SUBSCRIBE or AFTER-CAMPAIGN-OPEN |
autoresponder_event | string | no | Possible values: AFTER-SUBSCRIBE or AFTER-CAMPAIGN-OPEN |
autoresponder_time_unit | string | no | Possible values: minute, hour, day, week, month, year |
autoresponder_time_value | integer | no | The unit time value |
autoresponder_time_value | integer | no | The unit time value |
autoresponder_open_campaign_id | integer | no | Id of the campaign, only if event is AFTER-CAMPAIGN-OPEN |
cronjob | string | no | If this campaign is advanced recurring, you can set a cron job style frequency |
cronjob_enabled | integer | no | Possible values 1 or 0 |
Update an email campaign
This endpoint updates the campaign with the given CAMPAIGN-UNIQUE-ID
.
HTTP Request
PUT https://cp.spotzee.marketing/api/campaigns/CAMPAIGN-UNIQUE-ID
URL Segments
Segment | Required | Description |
---|---|---|
CAMPAIGN-UNIQUE-ID | yes | Campaign unique id to update. |
POST Parameters
Same as for the create campaign call.
Copy an email campaign
This endpoint copies the campaign with the given CAMPAIGN-UNIQUE-ID
.
HTTP Request
POST https://cp.spotzee.marketing/api/campaigns/CAMPAIGN-UNIQUE-ID/copy
URL Segments
Segment | Required | Description |
---|---|---|
CAMPAIGN-UNIQUE-ID | yes | Campaign unique id to copy. |
Pause/unpause an email campaign
This endpoint pauses/unpauses the campaign with the given CAMPAIGN-UNIQUE-ID
.
curl --location --request PUT 'https://cp.spotzee.marketing/api/campaigns/CAMPAIGN-UNIQUE-ID/pause-unpause' \
--header 'X-SPZ-PUBLIC-KEY: API-KEY'
HTTP Request
PUT https://cp.spotzee.marketing/api/campaigns/CAMPAIGN-UNIQUE-ID/pause-unpause
URL Segments
Segment | Required | Description |
---|---|---|
CAMPAIGN-UNIQUE-ID | yes | Campaign unique id to pause/unpause. |
Mark an email campaign as sent
curl --location --request PUT 'https://cp.spotzee.marketing/api/campaigns/CAMPAIGN-UNIQUE-ID/mark-sent' \
--header 'X-SPZ-PUBLIC-KEY: API-KEY'
// Mark CAMPAIGN as sent
$response = $endpoint->markSent('CAMPAIGN-UNIQUE-ID');
// DISPLAY RESPONSE
echo '<hr /><pre>';
print_r($response->body);
echo '</pre>';
# MARK ONE CAMPAIGN AS SENT
response = endpoint.mark_sent('CAMPAIGN_UID')
# DISPLAY RESPONSE
puts response.body
"""
MARK ONE CAMPAIGN AS SENT
"""
response = endpoint.mark_sent('CAMPAIGN_UID')
"""
DISPLAY RESPONSE
"""
print(response.content)
The above command returns an object structured like this JSON:
{
"status": "success",
"campaign": {
"status": "sent"
}
}
This endpoint mark as SENT the campaign with the given CAMPAIGN-UNIQUE-ID
.
HTTP Request
PUT https://cp.spotzee.marketing/api/campaigns/CAMPAIGN-UNIQUE-ID/mark-sent
URL Segments
Segment | Required | Description |
---|---|---|
CAMPAIGN-UNIQUE-ID | yes | Campaign unique id to mark as sent. |
Delete an email campaign
curl --location --request DELETE 'https://cp.spotzee.marketing/api/campaigns/CAMPAIGN-UNIQUE-ID' \
--header 'X-SPZ-PUBLIC-KEY: API-KEY'
// Delete CAMPAIGN
$response = $endpoint->delete('CAMPAIGN-UNIQUE-ID');
// DISPLAY RESPONSE
echo '<hr /><pre>';
print_r($response->body);
echo '</pre>';
# DELETE ONE CAMPAIGN
response = endpoint.delete('CAMPAIGN_UID')
# DISPLAY RESPONSE
puts response.body
"""
DELETE ONE CAMPAIGN
"""
response = endpoint.delete('CAMPAIGN_UID')
"""
DISPLAY RESPONSE
"""
print(response.content)
The above command returns an object structured like this JSON:
{
"status":"success"
}
This endpoint will delete the campaign with the given CAMPAIGN-UNIQUE-ID
.
HTTP Request
DELETE https://cp.spotzee.marketing/api/campaigns/CAMPAIGN-UNIQUE-ID
URL Segments
Segment | Required | Description |
---|---|---|
CAMPAIGN-UNIQUE-ID | yes | Campaign unique id to delete. |
Get stats on an email campaign
curl --location 'https://cp.spotzee.marketing/api/campaigns/CAMPAIGN-UNIQUE-ID/stats' \
--header 'X-SPZ-PUBLIC-KEY: API-KEY'
// GET STATS
$response = $endpoint->getStats('CAMPAIGN-UNIQUE-ID');
// DISPLAY RESPONSE
echo '<pre>';
print_r($response->body);
echo '</pre>';
# TODO - Implement
"""
TODO - Implement
"""
The above command returns an object structured like this JSON:
{
"status": "success",
"data": {
"campaign_status": "sent",
"subscribers_count": 0,
"processed_count": 0,
"delivery_success_count": 0,
"delivery_success_rate": 0,
"delivery_error_count": 0,
"delivery_error_rate": 0,
"opens_count": 0,
"opens_rate": 0,
"unique_opens_count": 0,
"unique_opens_rate": 0,
"clicks_count": 0,
"clicks_rate": 0,
"unique_clicks_count": 0,
"unique_clicks_rate": 0,
"unsubscribes_count": 0,
"unsubscribes_rate": 0,
"complaints_count": 0,
"complaints_rate": 0,
"bounces_count": 0,
"bounces_rate": 0,
"hard_bounces_count": 0,
"hard_bounces_rate": 0,
"soft_bounces_count": 0,
"soft_bounces_rate": 0,
"internal_bounces_count": 0,
"internal_bounces_rate": 0
}
}
This endpoint retrieves the campaign stats from the given CAMPAIGN-UNIQUE-ID
.
HTTP Request
GET https://cp.spotzee.marketing/api/campaigns/CAMPAIGN-UNIQUE-ID/stats
URL Segments
Segment | Required | Description |
---|---|---|
CAMPAIGN-UNIQUE-ID | yes | Campaign unique id to retrieve. |
Email campaigns tracking
curl --location 'https://cp.spotzee.marketing/api/campaigns/CAMPAIGN-UID/track-url/SUBSCRIBER-UNIQUE-ID/URL-HASH' \
--header 'X-SPZ-PUBLIC-KEY: API-KEY'
// Track subscriber click for campaign click
$response = $endpoint->trackUrl('CAMPAIGN-UNIQUE-ID', 'SUBSCRIBER-UNIQUE-ID', 'URL-HASH');
// DISPLAY RESPONSE
echo '<hr /><pre>';
print_r($response->body);
echo '</pre>';
# Track subscriber click for campaign click
response = endpoint.track_url('CAMPAIGN_UID', 'SUBSCRIBER_UID', 'HASH_URL')
# DISPLAY RESPONSE
puts response.body
"""
Track subscriber click for campaign click
"""
response = endpoint.track_url(campaign_uid='CAMPAIGN_UID', subscriber_uid='SUBSCRIBER_UID', hash_string='')
"""
DISPLAY RESPONSE
"""
print(response.content)
The above command returns an object structured like this JSON:
{
"status": "success",
"data": {}
}
Track subscriber clicks for the campaign. This endpoint set a campaign tracking URL click action.
HTTP Request
GET https://cp.spotzee.marketing/api/campaigns/CAMPAIGN-UID/track-url/SUBSCRIBER-UNIQUE-ID/URL-HASH
URL Segments
Segment | Required | Description |
---|---|---|
CAMPAIGN-UID | Yes | Campaign unique identifier. |
SUBSCRIBER-UNIQUE-ID | Yes | Subscriber unique identifier. |
URL-HASH | Yes | The url hash which the subscriber clicked. |
Track subscriber open
curl --location 'https://cp.spotzee.marketing/api/campaigns/CAMPAIGN-UID/track-opening/SUBSCRIBER-UID' \
--header 'X-SPZ-PUBLIC-KEY: API-KEY'
// Track subscriber open for campaign
$response = $endpoint->trackOpening('CAMPAIGN-UNIQUE-ID', 'SUBSCRIBER-UNIQUE-ID');
// DISPLAY RESPONSE
echo '<hr /><pre>';
print_r($response->body);
echo '</pre>';
# Track subscriber open for campaign
response = endpoint.track_opening('CAMPAIGN_UID', 'SUBSCRIBER_UID')
# DISPLAY RESPONSE
puts response.body
"""
Track subscriber open for campaign
"""
response = endpoint.track_opening(campaign_uid='CAMPAIGN_UID', subscriber_uid='SUBSCRIBER_UID')
"""
DISPLAY RESPONSE
"""
print(response.content)
The above command returns an object structured like this JSON:
{
"status": "success",
"data": {}
}
This endpoint sets the track campaign open for a certain subscriber.
HTTP Request
GET https://cp.spotzee.marketing/api/campaigns/CAMPAIGN-UID/track-opening/SUBSCRIBER-UID
URL Segments
Segment | Required | Description |
---|---|---|
CAMPAIGN-UID | Yes | Campaign unique identifier. |
SUBSCRIBER-UNIQUE-ID | Yes | Subscriber unique identifier. |
Track subscriber unsubscribe
curl --location 'https://cp.spotzee.marketing/api/campaigns/CAMPAIGN-UID/track-unsubscribe/SUBSCRIBER-UID' \
--header 'X-SPZ-PUBLIC-KEY: API-KEY' \
--form 'ip_address="123.123.123.123"' \
--form 'user_agent="Mozilla/5.0 (Macintosh; Intel Mac OS X 10_13_3) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/63.0.3239.132 Safari/537.36"' \
--form 'reason="Reason for unsubscribe!"'
// Track subscriber unsubscribe for campaign
$response = $endpoint->trackUnsubscribe('CAMPAIGN-UNIQUE-ID', 'SUBSCRIBER-UNIQUE-ID', [
'ip_address' => '123.123.123.123',
'user_agent' => 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_13_3) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/63.0.3239.132 Safari/537.36',
'reason' => 'Reason for unsubscribe!',
]);
// DISPLAY RESPONSE
echo '<hr /><pre>';
print_r($response->body);
echo '</pre>';
# Track subscriber unsubscribe for campaign
response = endpoint.track_unsubscribe('CAMPAIGN_UID', 'SUBSCRIBER_UID', {
'ip_address': '123.123.123.123',
'user_agent': 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_13_3) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/63.0.3239.132 Safari/537.36',
'reason': 'Reason for unsubscribe!',
})
# DISPLAY RESPONSE
puts response.body
"""
Track subscriber unsubscribe for campaign
"""
response = endpoint.track_unsubscribe(campaign_uid='CAMPAIGN_UID', subscriber_uid='SUBSCRIBER_UID', data={
'ip_address': '123.123.123.123',
'user_agent': 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_13_3) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/63.0.3239.132 Safari/537.36',
'reason': 'Reason for unsubscribe!',
})
"""
DISPLAY RESPONSE
"""
print(response.content)
The above command returns an object structured like this JSON:
{
"status": "success",
"data": {}
}
This endpoint sets the track campaign unsubscribe for a certain subscriber.
HTTP Request
POST https://cp.spotzee.marketing/api/campaigns/CAMPAIGN-UID/track-unsubscribe/SUBSCRIBER-UID
URL Segments
Segment | Required | Description |
---|---|---|
CAMPAIGN-UID | Yes | Campaign unique identifier. |
SUBSCRIBER-UNIQUE-ID | Yes | Subscriber unique identifier. |
POST Parameters
Parameter | Required | Description |
---|---|---|
ip_address | No | IP address from which the subscriber unsubscribes |
user_agent | No | Subscriber user agent |
reason | No | Unsubscribe reason |
Get all bounces
curl --location 'https://cp.spotzee.marketing/api/campaigns/CAMPAIGN-UNIQUE-ID/bounces?pageNumber=1&perPage=10' \
--header 'X-SPZ-PUBLIC-KEY: API-KEY'
// GET ALL ITEMS
$response = $endpoint->getBounces($campaignUid = CAMPAIGN-UNIQUE-ID, $pageNumber = 1, $perPage = 10);
// DISPLAY RESPONSE
echo "<pre>";
print_r($response->body);
echo "</pre>";
# GET ALL ITEMS
response = endpoint.get_bounces(campaign_uid = 'CAMAPAIGN-UNIQUE-ID', page = 1, per_page = 10)
# DISPLAY RESPONSE
puts response.body
"""
GET ALL ITEMS
"""
response = endpoint.get_bounces(campaign_uid='CAMAPAIGN-UNIQUE-ID', page=1, per_page=10)
"""
DISPLAY RESPONSE
"""
print(response.content)
The above command returns an object structured like this JSON:
{
"status": "success",
"data": {
"count": "1",
"total_pages": 1,
"current_page": 1,
"next_page": null,
"prev_page": null,
"records": [
{
"message": "5.1.1 : Recipient address rejected: User unknown in virtual mailbox table",
"processed": "no",
"bounce_type": "hard",
"subscriber": {
"subscriber_uid": "xq907cko16da3",
"email": "user@example.com"
}
}
]
}
}
This endpoint retrieves all the bounces of a campaign.
HTTP Request
GET https://cp.spotzee.marketing/api/campaigns/CAMPAIGN-UNIQUE-ID/bounces
URL Segments
Segment | Required | Description |
---|---|---|
CAMPAIGN-UNIQUE-ID | yes | Campaign unique id to retrieve the bounce. |
Query Parameters
Parameter | Default | Description |
---|---|---|
pageNumber | 1 | Current page to retrieve. |
perPage | 10 | Items per page to retrieve. |
Create a bounce
curl --location 'https://cp.spotzee.marketing/api/campaigns/CAMPAIGN-UNIQUE-ID/bounces' \
--header 'X-SPZ-PUBLIC-KEY: API-KEY' \
--form 'message="The reason why this email bounced"' \
--form 'bounce_type="hard"' \
--form 'subscriber_uid="SUBSCRIBER-UNIQUE-ID"'
// CREATE BOUNCE
$response = $endpoint->create('CAMPAIGN-UNIQUE-ID', [
'message' => 'The reason why this email bounced', // max 250 chars
'bounce_type' => 'hard', // hard, soft or internal
'subscriber_uid' => 'SUBSCRIBER-UNIQUE-ID' // 13 chars unique subscriber identifier
]);
// DISPLAY RESPONSE
echo '<hr /><pre>';
print_r($response->body);
echo '</pre>';
# CREATE BOUNCE
response = endpoint.create('CAMPAIGN-UNIQUE-ID', {
# required
'message': 'The reason why this email bounced',
'bounce_type': 'hard',
'subscriber_uid': 'SUBSCRIBER-UNIQUE-ID'
})
# DISPLAY RESPONSE
puts response.body
"""
CREATE BOUNCE
"""
response = endpoint.create('CAMPAIGN-UNIQUE-ID', {
# required
'message': 'The reason why this email bounced',
'bounce_type': 'hard',
'subscriber_uid': 'SUBSCRIBER-UNIQUE-ID'
})
"""
DISPLAY RESPONSE
"""
print(response.content)
The above command returns an object structured like this JSON:
{
"status": "success",
"data": {
"record": {
"message": "The reason why this email bounced",
"processed": "no",
"bounce_type": "hard",
"subscriber": {
"subscriber_uid": "fo428vd43x832",
"email": "user@example.com"
}
}
}
}
This endpoint creates a campaign bounce
HTTP Request
POST https://cp.spotzee.marketing/api/campaigns/CAMPAIGN-UNIQUE-ID/bounces
URL Segments
Segment | Required | Description |
---|---|---|
CAMPAIGN-UNIQUE-ID | yes | Campaign unique id to create the bounce. |
POST Parameters
Parameter | Required | Description |
---|---|---|
message | yes | The bounce message to be recorded. |
bounce_type | yes | Bounce type (hard, soft or internal). |
subscriber_uid | yes | The subscriber for which we record the bounce |
Email templates
Email templates endpoint
Not applicable
// CREATE THE ENDPOINT
$endpoint = new SpotzeeApi\Endpoint\Templates();
# CREATE THE ENDPOINT
endpoint = Templates.new
from spotzee.endpoint.templates import Templates
"""
CREATE THE ENDPOINT
"""
endpoint = Templates()
Get all email templates
curl --location 'https://cp.spotzee.marketing/api/templates?pageNumber=1&perPage=10' \
--header 'X-SPZ-PUBLIC-KEY: API-KEY'
// GET ALL ITEMS
$response = $endpoint->getTemplates($pageNumber = 1, $perPage = 10);
// DISPLAY RESPONSE
echo '<pre>';
print_r($response->body);
echo '</pre>';
# GET ALL TEMPLATES
response = endpoint.get_templates(page = 1, per_page = 10)
# DISPLAY RESPONSE
puts response.body
"""
GET ALL TEMPLATES
"""
response = endpoint.get_templates(page=1, per_page=10)
"""
DISPLAY RESPONSE
"""
print(response.content)
The above command returns an object structured like this JSON:
{
"status": "success",
"data": {
"records": [
{
"template_uid": "xxxxxxxxx",
"name": "portfolio_html (1)",
"screenshot": "https:\/\/domain.com\/frontend\/assets\/gallery\/ew055sq9tn97e\/img_ytStill.png"
}
]
}
}
This endpoint retrieves all the templates.
HTTP Request
GET https://cp.spotzee.marketing/api/templates
Query Parameters
Parameter | Default | Description |
---|---|---|
pageNumber | 1 | Current page to retrieve. |
perPage | 10 | Items per page to retrieve. |
Get one email template
curl --location 'https://cp.spotzee.marketing/api/templates/TEMPLATE-UNIQUE-ID' \
--header 'X-SPZ-PUBLIC-KEY: API-KEY'
// GET ONE ITEM
$response = $endpoint->getTemplate('TEMPLATE-UNIQUE-ID');
// DISPLAY RESPONSE
echo '<hr /><pre>';
print_r($response->body);
echo '</pre>';
# GET ONE ITEM
response = endpoint.get_template(template_uid = 'TEMPLATE-UNIQUE-ID')
# DISPLAY RESPONSE
puts response.body
"""
GET ONE ITEM
"""
response = endpoint.get_template(template_uid='TEMPLATE-UNIQUE-ID')
"""
DISPLAY RESPONSE
"""
print(response.content)
The above command returns an object structured like this JSON:
{
"status": "success",
"data": {
"record": {
"name": "portfolio_html (1)",
"content": "HTML content...",
"screenshot": "https:\/\/domain.com\/frontend\/assets\/gallery\/ew055sq9tn97e\/img_ytStill.png"
}
}
}
This endpoint retrieves the template with the given TEMPLATE-UNIQUE-ID
.
HTTP Request
GET https://cp.spotzee.marketing/api/templates/TEMPLATE-UNIQUE-ID
URL Segments
Segment | Required | Description |
---|---|---|
TEMPLATE-UNIQUE-ID | yes | Template unique id which to retrieve. |
Search email templates
curl --location --request GET 'https://cp.spotzee.marketing/api/templates?pageNumber=1&perPage=10' \
--header 'X-SPZ-PUBLIC-KEY: API-KEY' \
--form 'filters[name]="my template name"'
// Search ALL ITEMS
$response = $endpoint->searchTemplates($pageNumber = 1, $perPage = 10, [
'name' => 'my template name'
]);
// DISPLAY RESPONSE
echo '<pre>';
print_r($response->body);
echo '</pre>';
# SEARCH FOR TEMPLATES
response = endpoint.search_templates(page = 1, per_page = 10, filters = {
'name': 'example-template'
})
# DISPLAY RESPONSE
puts response.body
"""
SEARCH FOR TEMPLATES
"""
response = endpoint.search_templates(page=1, per_page=10, filters={
'name': 'example-template'
})
"""
DISPLAY RESPONSE
"""
print(response.content)
The above command returns an object structured like this JSON:
{
"status": "success",
"data": {
"records": [
{
"name": "portfolio_html (1)",
"content": "HTML content...",
"screenshot": "https:\/\/domain.com\/frontend\/assets\/gallery\/ew055sq9tn97e\/img_ytStill.png"
}
]
}
}
This endpoint retrieves the templates based on the filter key values.
HTTP Request
GET https://cp.spotzee.marketing/api/templates
Query Parameters
Parameter | Type | Required/Default | Description |
---|---|---|---|
page | int | 1 | Current page to retrieve. |
per_page | int | 10 | Items per page to retrieve. |
filters | array | yes | Indexed array having template attributes as keys.(i.e.: name ) |
Create an email template
curl --location 'https://cp.spotzee.marketing/api/templates' \
--header 'X-SPZ-PUBLIC-KEY: API-KEY' \
--form 'name="My API template"' \
--form 'content=@"/Desktop/template-example.html"' \
--form 'archive=@"/Desktop/template-example.zip"' \
--form 'inline_css="no"'
// CREATE A NEW TEMPLATE
$rand = rand();
$response = $endpoint->create([
'name' => 'My API template ' . $rand,
'content' => file_get_contents(__DIR__ . '/template-example.html'),
//'archive' => file_get_contents(__DIR__ . '/template-example.zip'),
'inline_css' => 'no',// yes|no
]);
// DISPLAY RESPONSE
echo '<hr /><pre>';
print_r($response->body);
echo '</pre>';
# CREATE ONE TEMPLATE
response = endpoint.create(data = {
'name': 'My API template ',
# 'content': '<body>Hello</body>',
# 'content': File.read('template-example.html'),
# 'archive': File.read('template-example.zip'), - TODO - Request entity too large for zip in all the endpoints
'inline_css': 'no', # yes|no
})
# DISPLAY RESPONSE
puts response.body
"""
CREATE ONE TEMPLATE
"""
response = endpoint.create(data={
'name': 'My API template ',
# 'content': '<body>Hello</body>',
# 'content': open('template-example.html', 'r').read(),
'archive': open('template-example.zip', 'rb').read(),
'inline_css': 'no', # yes|no
})
"""
DISPLAY RESPONSE
"""
print(response.content)
The above command returns an object structured like this JSON:
{
"status": "success",
"template_uid": "jo441taeq281e"
}
This endpoint creates a template.
HTTP Request
POST https://cp.spotzee.marketing/api/templates
POST Parameters
Parameter | Type | Required | Description |
---|---|---|---|
data | array | yes | Array with the template details. |
Data block - required
Parameter | Type | Required | Description |
---|---|---|---|
name | string | yes | Template name |
content | string | yes | The template content |
archive | string | no | Zip archive name on the disk. This can be used when not using the plain content key |
inline_css | Yes/No | no | Allow/disallow inline css |
Update an email template
curl --location --request PUT 'https://cp.spotzee.marketing/api/templates/TEMPLATE-UNIQUE-ID' \
--header 'X-SPZ-PUBLIC-KEY: API-KEY' \
--form 'name="My API template"' \
--form 'content=@"/Desktop/template-example.html"' \
--form 'archive=@"/Desktop/template-example.zip"' \
--form 'inline_css="no"'
// UPDATE A TEMPLATE
$response = $endpoint->update('TEMPLATE-UNIQUE-ID', [
'name' => 'My API template - updated' . $rand,
'content' => file_get_contents(__DIR__ . '/template-example.html'),
//'archive' => file_get_contents(__DIR__ . '/template-example.zip'),
'inline_css' => 'no',// yes|no
]);
// DISPLAY RESPONSE
echo '<hr /><pre>';
print_r($response->body);
echo '</pre>';
# UPDATE ONE TEMPLATE
response = endpoint.update(template_uid = 'TEMPLATE-UNIQUE-ID', data = {
'name': 'My API template - Updated',
# 'content': open('template-example.html', 'rb').read(),
# 'archive': open('template-example.zip', 'rb').read(),
'inline_css': 'no', # yes|no
})
# DISPLAY RESPONSE
puts response.body
"""
UPDATE ONE TEMPLATE
"""
response = endpoint.update(template_uid='TEMPLATE-UNIQUE-ID', data={
'name': 'My API template - Updated',
# 'content': open('template-example.html', 'rb').read(),
# 'archive': open('template-example.zip', 'rb').read(),
'inline_css': 'no', # yes|no
})
"""
DISPLAY RESPONSE
"""
print(response.content)
The above command returns an object structured like this JSON:
{
"status": "success"
}
This endpoint updates a template.
HTTP Request
PUT https://cp.spotzee.marketing/api/templates/TEMPLATE-UNIQUE-ID
URL Segments
Segment | Required | Description |
---|---|---|
TEMPLATE-UNIQUE-ID | yes | Template unique identifier |
PUT Parameters
Parameter | Type | Required | Description |
---|---|---|---|
data | array | yes | Array with the template details. See the create section for details |
Delete an email template
curl --location --request DELETE 'https://cp.spotzee.marketing/api/templates/TEMPLATE-UNIQUE-ID' \
--header 'X-SPZ-PUBLIC-KEY: API-KEY'
// delete template
$response = $endpoint->delete('TEMPLATE-UNIQUE-ID');
// DISPLAY RESPONSE
echo '<hr /><pre>';
print_r($response->body);
echo '</pre>';
# DELETE A TEMPLATE
response = endpoint.delete('TEMPLATE-UNIQUE-ID')
# DISPLAY RESPONSE
puts response.body
"""
DELETE A TEMPLATE
"""
response = endpoint.delete('TEMPLATE-UNIQUE-ID')
"""
DISPLAY RESPONSE
"""
print(response.content)
The above command returns an object structured like this JSON:
{
"status": "success"
}
This endpoint will delete the template with the given TEMPLATE-UNIQUE-ID
.
HTTP Request
DELETE https://cp.spotzee.marketing/api/templates/TEMPLATE-UNIQUE-ID
URL Segments
Segment | Required | Description |
---|---|---|
TEMPLATE-UNIQUE-ID | yes | Template unique id to delete. |
Email validation
Email validation endpoint
Not applicable
// CREATE THE ENDPOINT
$endpoint = new SpotzeeApi\Endpoint\EmailValidation();
# CREATE THE ENDPOINT
endpoint = EmailValidation.new
from spotzee.endpoint.emailvalidation import EmailValidation
"""
CREATE THE ENDPOINT
"""
endpoint = EmailValidation()
Validate a single email
curl --location 'https://cp.spotzee.marketing/api/email-validation/validate-single' \
--header 'X-SPZ-PUBLIC-KEY: API-KEY' \
--form 'email="john.doe@doe.com"'
// VALIDATE A SINGLE EMAIL
$response = $endpoint->create([
'email' => 'john.doe@doe.com' // required
]);
// DISPLAY RESPONSE
echo '<hr /><pre>';
print_r($response->body);
echo '</pre>';
# VALIDATE A SINGLE EMAIL
response = endpoint.create(data = {
'email': 'john.doe@doe.com' # required
})
# DISPLAY RESPONSE
puts response.body
"""
VALIDATE A SINGLE EMAIL
"""
response = endpoint.create(data={
'email': 'john.doe@doe.com' # required
})
"""
DISPLAY RESPONSE
"""
print(response.content)
The above command returns an object structured like this JSON:
{
"status": "success",
"data": {
"email": "john.doe@doe.com",
"result": "catch_all",
"resultcode": 2
}
}
This endpoint validates a single email.
HTTP Request
POST https://cp.spotzee.marketing/api/email-validation/validate-single
POST Parameters
Parameter | Type | Required | Description |
---|---|---|---|
string | yes | The email address you would like to validate. |
Validate via file upload
curl --location 'https://cp.spotzee.marketing/api/email-validation/file-upload' \
--header 'X-SPZ-PUBLIC-KEY: API-KEY' \
--form 'file=@"email="/file.csv"'
// VALIDATE MULTIPLE EMAILS
$response = $endpoint->create([
'file' => file_get_contents(__DIR__ . '/file.csv')
]);
// DISPLAY RESPONSE
echo '<hr /><pre>';
print_r($response->body);
echo '</pre>';
# VALIDATE MULTIPLE EMAILS
response = endpoint.create(data = {
'file': File.read('file.csv')
})
# DISPLAY RESPONSE
puts response.body
"""
VALIDATE MULTIPLE EMAILS
"""
response = endpoint.create(data={
'file': open('file.csv', 'r').read()
})
"""
DISPLAY RESPONSE
"""
print(response.content)
The above command returns an object structured like this JSON:
{
"status": "success",
"data": {
"unique_emails": 100,
"file_id": 13777
}
}
This endpoint validates multiple emails that exist in the provided file.
HTTP Request
POST https://cp.spotzee.marketing/api/email-validation/file-upload
POST Parameters
Parameter | Type | Required | Description |
---|---|---|---|
file | string | yes | The file containing all the email address you would like to validate. We accept CSV, TXT, XLSX formats. |
Get the file information
curl --location 'https://cp.spotzee.marketing/api/email-validation/file-info' \
--header 'X-SPZ-PUBLIC-KEY: API-KEY' \
--form 'file_id="FILE-ID"'
// GET THE FILE INFORMATION
$response = $endpoint->create([
'file_id' => 'FILE-ID' // required
]);
// DISPLAY RESPONSE
echo '<hr /><pre>';
print_r($response->body);
echo '</pre>';
# GET THE FILE INFORMATION
response = endpoint.create(data = {
'file_id': 'FILE-ID' # required
})
# DISPLAY RESPONSE
puts response.body
"""
GET THE FILE INFORMATION
"""
response = endpoint.create(data={
'file_id': 'FILE-ID' # required
})
"""
DISPLAY RESPONSE
"""
print(response.content)
The above command returns an object structured like this JSON:
{
"status": "success",
"data": {
"ok": 50,
"invalid": 21,
"unknown": 5,
"revalidate": 2,
"validated": 90,
"catch_all": 10,
"disposable": 7,
"invalidated": 10,
"unique_emails": 100,
"status": "completed"
}
}
This endpoint gets the information about the file uploaded.
HTTP Request
POST https://cp.spotzee.marketing/api/email-validation/file-info
POST Parameters
Parameter | Type | Required | Description |
---|---|---|---|
file_id | integer | yes | The file ID you would like the information on. |
Download the results
curl --location 'https://cp.spotzee.marketing/api/email-validation/download-results?file_id=FILE-ID&filter=FILTERS&statuses=STATUSES&free=0&role=0' \
--header 'X-SPZ-PUBLIC-KEY: API-KEY'
// DOWNLOAD THE RESULTS
$response = $endpoint->create([
'file_id' => 'FILE-ID', // required
'filter' => 'FILTERS', // required
'statuses' => 'STATUSES',
'free' => '0',
'role' => '0'
]);
// DISPLAY RESPONSE
echo '<hr /><pre>';
print_r($response->body);
echo '</pre>';
# VALIDATE A SINGLE EMAIL
response = endpoint.create(data = {
'file_id': 'FILE-ID', # required
'filter': 'FILTERS', # required
'statuses': 'STATUSES',
'free': '0',
'role': '0'
})
# DISPLAY RESPONSE
puts response.body
"""
VALIDATE A SINGLE EMAIL
"""
response = endpoint.create(data={
'file_id': 'FILE-ID', # required
'filter': 'FILTERS', # required
'statuses': 'STATUSES',
'free': '0',
'role': '0'
})
"""
DISPLAY RESPONSE
"""
print(response.content)
The above command returns an object structured like this JSON:
"email","quality","result","free","role","name","attributes"
"john.doe-1@doe.com","good","ok","yes","yes","John Doe","{""age"": 42, ""planet"": ""Mars""}"
"john.doe-2@doe.com","good","ok","yes","no","John Doe","{""age"": 24, ""job"": ""Time Traveller""}"
This endpoint downloads email validation results.
HTTP Request
POST https://cp.spotzee.marketing/api/email-validation/download-results
Query Parameters
Parameter | Type | Required | Description |
---|---|---|---|
file_id | string | yes | The results you want to download for a given file. |
filter | string | yes | The filtered downloadable results. Possible values are ok , ok_and_catch_all , unknown , invalid , all , custom . |
statuses | string | no | The filtered downloadable results. Possible values are ok , catch_all , unknown , invalid , disposable . Eg. statuses=ok,invalid,disposable |
free | string | no | The option to filter free email service provider’s emails. Possible values are 0 , 1 . |
role | string | no | The option to filter role-based email addresses. Possible values are 0 , 1 . |
Delete a file
curl --location --request DELETE 'https://cp.spotzee.marketing/api/email-validation/delete-file?file_id=FILE-ID' \
--header 'X-SPZ-PUBLIC-KEY: API-KEY'
// DELETE A FILE
$response = $endpoint->delFile($file_id = FILE-ID);
// DISPLAY RESPONSE
echo '<pre>';
print_r($response->body);
echo '</pre>';
# DELETE A FILE
response = endpoint.del_file(file_id = FILE-ID)
# DISPLAY RESPONSE
puts response.body
"""
DELETE A FILE
"""
response = endpointLists.del_file(file_id=FILE-ID)
"""
DISPLAY RESPONSE
"""
print(response.content)
The above command returns an object structured like this JSON:
{
"status": "success",
"data": {
"result": "ok"
}
}
This endpoint deletes the file uploaded for processing.
HTTP Request
DELETE https://cp.spotzee.marketing/api/email-validation/delete-file
Query Parameters
Parameter | Type | Required | Description |
---|---|---|---|
file_id | integer | yes | The file ID you would like to delete. |
Get the balance
curl --location 'https://cp.spotzee.marketing/api/email-validation/balance' \
--header 'X-SPZ-PUBLIC-KEY: API-KEY'
// VALIDATE A SINGLE EMAIL
$response = $endpoint->create([]);
// DISPLAY RESPONSE
echo '<hr /><pre>';
print_r($response->body);
echo '</pre>';
# VALIDATE A SINGLE EMAIL
response = endpoint.create(data = {})
# DISPLAY RESPONSE
puts response.body
"""
VALIDATE A SINGLE EMAIL
"""
response = endpoint.create(data={})
"""
DISPLAY RESPONSE
"""
print(response.content)
The above command returns an object structured like this JSON:
{
"status": "success",
"data": {
"balance": 100
}
}
This endpoint retrieves the credit balance.
HTTP Request
GET https://cp.spotzee.marketing/api/email-validation/balance
Countries
Countries endpoint
Not applicable
// CREATE THE ENDPOINT
$endpoint = new SpotzeeApi\Endpoint\Countries();
# CREATE THE ENDPOINT
endpoint = Countries.new
from spotzee.endpoint.countries import Countries
"""
CREATE THE ENDPOINT
"""
endpoint = Countries()
Get all countries
curl --location 'https://cp.spotzee.marketing/api/countries?pageNumber=1&perPage=10' \
--header 'X-SPZ-PUBLIC-KEY: API-KEY'
// GET ALL ITEMS
$response = $endpoint->getCountries($pageNumber = 23, $perPage = 10);
// DISPLAY RESPONSE
echo '<pre>';
print_r($response->body);
echo '</pre>';
# GET ALL ITEMS
response = endpoint.get_countries(page = 1, per_page = 10)
# DISPLAY RESPONSE
puts response.body
"""
GET ALL ITEMS
"""
response = endpoint.get_countries(page=1, per_page=10)
"""
DISPLAY RESPONSE
"""
print(response.content)
The above command returns an object structured like this JSON:
{
"status": "success",
"data": {
"count": "240",
"total_pages": 24,
"current_page": 23,
"next_page": 24,
"prev_page": 22,
"records": [
{
"country_id": "218",
"name": "Tuvalu",
"code": "TV"
},
{
"country_id": "219",
"name": "Uganda",
"code": "UG"
},
{
"country_id": "220",
"name": "Ukraine",
"code": "UA"
},
{
"country_id": "221",
"name": "United Arab Emirates",
"code": "AE"
},
{
"country_id": "222",
"name": "United Kingdom",
"code": "GB"
},
{
"country_id": "223",
"name": "United States",
"code": "US"
},
{
"country_id": "224",
"name": "United States Minor Outlying Islands",
"code": "UM"
},
{
"country_id": "225",
"name": "Uruguay",
"code": "UY"
},
{
"country_id": "226",
"name": "Uzbekistan",
"code": "UZ"
},
{
"country_id": "227",
"name": "Vanuatu",
"code": "VU"
}
]
}
}
This endpoint retrieves all the countries.
HTTP Request
GET https://cp.spotzee.marketing/api/countries
Query Parameters
Parameter | Default | Description |
---|---|---|
pageNumber | 1 | Current page to retrieve. |
perPage | 10 | Items per page to retrieve. |
Get all zones of a country
curl --location 'https://cp.spotzee.marketing/api/countries/COUNTRY-ID/zones?pageNumber=1&perPage=10' \
--header 'X-SPZ-PUBLIC-KEY: API-KEY'
// get country zones
$response = $endpoint->getZones(COUNTRY-ID, $pageNumber = 1, $perPage = 10);
// DISPLAY RESPONSE
echo '<hr /><pre>';
print_r($response->body);
echo '</pre>';
# GET COUNTRY ZONES
response = endpoint.get_zones(country_id = COUNTRY-ID, page = 1, per_page = 10)
# DISPLAY RESPONSE
puts response.body
"""
GET COUNTRY ZONES
"""
response = endpoint.get_zones(country_id=COUNTRY-ID, page=1, per_page=10)
"""
DISPLAY RESPONSE
"""
print(response.content)
The above command returns an object structured like this JSON:
{
"status": "success",
"data": {
"count": "65",
"total_pages": 7,
"current_page": 1,
"next_page": 2,
"prev_page": null,
"records": [
{
"zone_id": "3613",
"name": "Alabama",
"code": "AL"
},
{
"zone_id": "3614",
"name": "Alaska",
"code": "AK"
},
{
"zone_id": "3615",
"name": "American Samoa",
"code": "AS"
},
{
"zone_id": "3616",
"name": "Arizona",
"code": "AZ"
},
{
"zone_id": "3617",
"name": "Arkansas",
"code": "AR"
},
{
"zone_id": "3618",
"name": "Armed Forces Africa",
"code": "AF"
},
{
"zone_id": "3619",
"name": "Armed Forces Americas",
"code": "AA"
},
{
"zone_id": "3620",
"name": "Armed Forces Canada",
"code": "AC"
},
{
"zone_id": "3621",
"name": "Armed Forces Europe",
"code": "AE"
},
{
"zone_id": "3622",
"name": "Armed Forces Middle East",
"code": "AM"
}
]
}
}
This endpoint retrieves all the zones of a country.
HTTP Request
GET https://cp.spotzee.marketing/api/countries/COUNTRY-ID/zones
URL Segments
Segment | Required | Description |
---|---|---|
COUNTRY-ID | Yes | Country ID to retrieve zones for. |
Query Parameters
Parameter | Default | Description |
---|---|---|
pageNumber | 1 | Current page to retrieve. |
perPage | 10 | Items per page to retrieve. |