Introduction
The Acelle Mail API (version 1.0) is organized around REST. Our API has predictable resource-oriented URLs, accepts form-encoded request bodies, returns JSON-encoded responses, and uses standard HTTP response codes, authentication, and verbs.
The first step is to install your Acelle web application. We have Installation & Getting started guidelines (for cPanel or unmanaged server/VPS) included in the guideline/
folder of the software package you download from CodeCanyon. It is in HTML format, you can just go to the guideline/ folder, double click on the index.html file to open it on your browser.
The Acelle Mail API may differ as we release new versions over time. Log in to your installation of Acelle to see the particular version, API base URI and authentication key.
Visit our product page for latest updates.
Not a developer?
Acelle Mail is made for users without software programming experience. Just follow the installation & getting started guideline included in our software package to install the web application to your hosting server which can be either a VPS (Virtual Private Server) or a managed server's environment with a control panel like cPanel or Plesk.
Custom development & integration
Acelle is pre-designed for rebranding, customization and integration. Our Acelle SDK is written in PHP, however, you can use any programming language to interact with Acelle's RESTful API.
composer require acelle/sdk-php
sudo apt install curl
Authentication
Acelle Mail API employs simple Token Authentication which is also referred to as Bearer Authentication.
That is, every Acelle user account has an authentication token. The token must be sent in either the Authorization
HTTP header or in the query string URL when making requests to protected resources:
Authorization: Bearer <token>
Or as a query string parameter in the request URL
https://acelle.com/api/v1?api_token=YOUR_API_TOKEN
Find your API Token
You will need to first login to your Acelle account to find the API TOKEN which is available in the My Profile > API & Authentication
dashboard
API endpoint
Acelle is a self-hosted web platform and every instance of Acelle has its own API endpoint. Remember to replace acelle.com
with your own installation's hostname when executing an API call.
One-click Login
Sometimes it is useful to have a one-click login URL so that users can login to their Acelle Mail's dashboard without having to enter their username or password. User can just click on a one-time login link to get logged in to the web UI. It is especially helpful when you use Acelle with another application and you do not want to have your users enter their username or password twice. And you do not want to employ a complicated authentication mechanism like SSO (Single Sign-on). Then using a one-click login URL comes in handy.
It is as simple as making a POST request to /login-token
resource to obtain a one-time login token as well as the one-time login URL
Parameters
curl -X POST -H "accept:application/json" -G \
http://acelle.wsl/api/v1/login-token \
-d api_token=*|token_string|*
$client = new Acelle\Client(
'http://acelle.local/api/v1',
'*|api_token|*'
);
$client->loginToken();
{
"token": "8vunPVPUDBMGYOEk9",
"url": "http://example.com/login/token/8vunPVPUDBMGYOEk9"
}
Lists
Mail Lists, also referred to as Audience, are at the center of email marketing management systems.
It is designed to help you collect and manage subscribed, non-subscribed, and unsubscribed contacts.
Acelle's List API allows you to create, edit your mail lists as well as manage your lists' contacts.
View Lists
Retrieve all your mail lists as well as every mail list's details like name, description, etc. You can also find every list's UID which is used as reference key for a particular list
Parameters
curl -X GET -H "accept:application/json" -G \
http://acelle.wsl/api/v1/lists \
-d api_token=*|token_string|*
$client = new Acelle\Client(
'http://acelle.local/api/v1',
'*|api_token|*'
);
$client->list()->all();
[
{
"id": 1,
"uid": "5fade5c93e42a",
"name": "My Awesome Campaign",
"default_subject": "An Awesome Subject",
"from_email": "support@acelle.com",
"from_name": "Customer Support",
"status": null,
"created_at": "2021-11-13 01:47:53",
"updated_at": "2021-12-04 07:29:24"
},
{
"id": 2,
"uid": "5fc9e55410e10",
"name": "List 1",
...
},
...
]
Create List
A mail list is a collection of email addresses used by an individual or an organization to send marketing material to multiple recipients. You can have different lists of different group of contacts
Make a POST request to the /list
resource along with your desired list details to create. On success, a unique List UID
key is returned for the newly created list, which is used as a reference key for interacting with it.
Parameters
curl -X POST -H "accept:application/json" -G \
http://acelle.wsl/api/v1/lists \
-d api_token=*|token_string|* \
-d name=List+1 \
-d from_email=admin@abccorp.org \
-d from_name=ABC+Corp. \
-d default_subject=Welcome+to+ABC+Corp. \
-d contact[company]=ABC+Corp. \
-d contact[state]=Armagh \
-d contact[address_1]=14+Tottenham+Court+Road+London+England \
-d contact[address_2]=44-46+Morningside+Road+Edinburgh+Scotland \
-d contact[city]=Noname \
-d contact[zip]=80000 \
-d contact[phone]=123+456+889 \
-d contact[country_id]=1 \
-d contact[email]=info@abccorp.org \
-d contact[url]=http://www.abccorp.org \
-d subscribe_confirmation=1 \
-d send_welcome_email=1 \
-d unsubscribe_notification=1
$client = new Acelle\Client(
'http://acelle.local/api/v1',
'*|api_token|*'
);
$client->list()->create([
'name' => 'List+1',
'from_email' => 'admin@abccorp.org',
'from_name' => 'ABC+Corp.',
'default_subject' => 'Welcome+to+ABC+Corp.',
'contact' => [
'company' => 'ABC+Corp.',
'state' => 'Armagh',
'address_1' => '14+Tottenham+Court+Road+London+England',
'address_2' => '44-46+Morningside+Road+Edinburgh+Scotland',
'city' => 'Noname',
'zip' => '80000',
'phone' => '123+456+889',
'country_id' => '1',
'email' => 'info@abccorp.org',
'url' => 'http://www.abccorp.org',
],
'subscribe_confirmation' => '1',
'send_welcome_email' => '1',
'unsubscribe_notification' => '1',
]);
{
"status": 1,
"message": "List was successfully created",
"list_uid": "5fc9e55410e10"
}
Get List Details
Get detailed information of a List identified by a given UID
passed to the API call.
Parameters
curl -X GET -H "accept:application/json" -G \
http://acelle.wsl/api/v1/lists/{uid} \
-d api_token=*|token_string|*
$client = new Acelle\Client(
'http://acelle.local/api/v1',
'*|api_token|*'
);
$client->list()->find('*|uid|*');
{
"list": {
"uid": "5fc9e55410e10",
"name": "List 1",
"default_subject": "Welcome to ABC Corp.",
"from_email": "admin@abccorp.org",
"from_name": "ABC Corp.",
"remind_message": null,
"status": null,
"created_at": [],
"updated_at": [],
"fields": [
{
"key": "EMAIL",
"label": "Email",
"type": "string",
"tag": "EMAIL",
"default_value": null,
"visible": "1",
"required": true,
"custom_order": null
},
..
]
},
"contact": {
"company": "ABC Corp.",
"address_1": "14 Tottenham Court Road London England",
"address_2": "44-46 Morningside Road Edinburgh Scotland EH10 4BF",
"country": "Afghanistan",
"state":"Armagh",
"zip": "80000",
"phone": "123 456 889",
"url": "http:\/\/www.abccorp.org",
"email": "info@abccorp.org",
"city": "Noname"
},
"statistics": {
"subscriber_count": 0,
"open_uniq_rate": 0,
"click_rate": 0,
"subscribe_rate": 0,
"unsubscribe_rate": 0,
"unsubscribe_count": 0,
"unconfirmed_count": 0
}
}
Add Custom Field
Beside common fields of a contact like emails, names, addresses, cellphone numbers, etc. You can add customized fields to your mail lists to store more information about your list's contacts such as their preferences, scores, etc. and then you can organize contacts based on specific interest groups within your list/audience.
Parameters
curl -X GET -H "accept:application/json" -G \
http://acelle.wsl/api/v1/lists/{uid}/add-field \
-d api_token=*|token_string|* \
-d type=text \
-d label=Custom \
-d tag=CUSTOM_FIELD_1 \
-d default_value=test
$client = new Acelle\Client(
'http://acelle.local/api/v1',
'*|api_token|*'
);
$client->list()->addCustomField('5fd18406c7b1d', [
'type' => 'text',
'label' => 'Custom',
'tag' => 'CUSTOM_FIELD_1',
'default_value' => 'test',
]);
{
"status": 1,
"message": "List's field was created",
"field": {
"mail_list_id": 2,
"type": "text",
"label": "Custom",
"tag":"CUSTOM_FIELD_1",
"default_value":"test",
"uid":"5fcae3cb6298f",
"updated_at":"2020-12-05 01:35:07",
"created_at":"2020-12-05 01:35:07","id":7
}
}
Delete List
Delete a list and completely erase the list's information in the web platform.
Parameters
curl -X DELETE -H "accept:application/json" -G \
http://acelle.wsl/api/v1/lists/{uid} \
-d api_token=*|token_string|*
$client = new Acelle\Client(
'http://acelle.local/api/v1',
'*|api_token|*'
);
$client->list()->delete('e31046fce3d83');
{
"status": 1,
"message": "Deleted"
}
Subscribers
By definition, a subscriber is usually someone who is a member of one or more of your lists.
They may have subscribed themselves to your mail list via a subscription page or web form, or you may have imported their details from another source.
Subscribers are also referred to as Audience in Acelle email marketing web platform
List Subscribers
List all subscribers of a given list identified by a UID
Parameters
curl -X GET -H "accept:application/json" -G \
http://acelle.wsl/api/v1/subscribers \
-d api_token=*|token_string|* \
-d list_uid=*|list_uid|* \
-d per_page=20 \
-d page=1
$client = new Acelle\Client(
'http://acelle.local/api/v1',
'*|api_token|*'
);
$client->subscriber()->all([
'list_uid' => '5fade5c93e42a',
'per_page' => '20',
'page' => '1',
]);
[
{
"uid": "5fd07b8b65284",
"email": "nickyu88@gmail.com",
"status": "subscribed",
"FIRST_NAME": "Nick",
"LAST_NAME": "KKu",
"CUSTOM_FIELD_1": "test"
},
...
]
Add Subscriber
Add a subscriber to a list identified by a UID
. Once added, the subscriber's status would be either subscribed / active
or pending
depending on your list settings (single opt-in or double opt-in)
Parameters
curl -X POST -H "accept:application/json" -G \
http://acelle.wsl/api/v1/subscribers \
-d api_token=*|token_string|* \
-d EMAIL=test@gmail.com \
-d tag=foo,bar,tag+with+space, \
-d FIRST_NAME=Marine \
-d LAST_NAME=Joze
$client = new Acelle\Client(
'http://acelle.local/api/v1',
'*|api_token|*'
);
$client->subscriber()->create([
'list_uid' => '5fade5c93e42a',
'EMAIL' => 'test@gmail.com',
'tag' => 'foo,bar,tag+with+space,',
'FIRST_NAME' => 'Marine',
'LAST_NAME' => 'Joze',
]);
{
"status": 1,
"message": "Confirmation email sent to the subscriber",
"subscriber_uid": "5fd07ca421da0"
}
Get Subscriber's Details
Get detailed information of a subscriber identified by an UID
code. Notice that a subscriber's UID is globally unique. A contact identified by his/her email address may have more than one UID if he or she is added to more than one list.
Parameters
curl -X GET -H "accept:application/json" -G \
http://acelle.wsl/api/v1/subscribers/{uid} \
-d api_token=*|token_string|*
$client = new Acelle\Client(
'http://acelle.local/api/v1',
'*|api_token|*'
);
$client->subscriber()->find('e31046fce3d83');
{
"subscriber": {
"uid":"5fd07b8b65284",
"email":"anna122@gmail.com",
"status":"subscribed",
"source":null,
"ip_address":null,
"FIRST_NAME":"Ann",
"LAST_NAME":"Anna",
"CUSTOM_FIELD_1":"test"
}
}
Update Subscriber Information
Update a subscriber's details, identified by subscriber UID
. Notice that a subscriber's UID is globally unique. A contact identified by his/her email address may have more than one UID if he or she is added to more than one list.
Parameters
curl -X PATCH -H "accept:application/json" -G \
http://acelle.wsl/api/v1/subscribers/{uid} \
-d api_token=*|token_string|* \
-d EMAIL=test@gmail.com \
-d tag=foo,bar,tag+with+space \
-d FIRST_NAME=Marine \
-d LAST_NAME=Joze
$client = new Acelle\Client(
'http://acelle.local/api/v1',
'*|api_token|*'
);
$client->subscriber()->update('e31046fce3d83', [
'EMAIL' => 'test2@gmail.com',
'tag' => 'foo,bar,tag+with+space,',
'FIRST_NAME' => 'Marine',
'LAST_NAME' => 'Joze',
]);
{
"status": 1,
"message": "Subscriber was successfully updated",
"subscriber_uid": "5fd07b8b65284"
}
Find Subscribers by Email
In Acelle platform, a contact is identified by his/her unique email address and he or she may belong to more than one list with different list's specific values. For example, a contact may have different ADDRESS values in different lists
Parameters
curl -X GET -H "accept:application/json" -G \
http://acelle.wsl/api/v1/subscribers/email/{email} \
-d api_token=*|token_string|* \
-d email=test22@gmail.com
$client = new Acelle\Client(
'http://acelle.local/api/v1',
'*|api_token|*'
);
$client->subscriber()->findByEmail('test22@gmail.com');
{
"subscribers": [
{
"uid":"5fd07b8b65284",
"list_uid":"5fc9e55410e10",
"email":"test22@gmail.com",
"status":"subscribed",
"source":null,
"ip_address":null,
"FIRST_NAME":"Marine",
"LAST_NAME":"Joze",
"CUSTOM_FIELD_1":null
}
]
}
Add Tag
Add one or more tags to a given subscriber. Tagging allows you to add custom labels to your subscribers, giving you the ability to reach people based on specific traits.
Parameters
curl -X POST -H "accept:application/json" -G \
http://acelle.wsl/api/v1/subscribers \
-d api_token=*|token_string|* \
-d tag=foo,bar,tag+with+space,
$client = new Acelle\Client(
'http://acelle.local/api/v1',
'*|api_token|*'
);
$client->subscriber()->addTag('5fade5c93e42a', [
'tag' => 'foo,bar,tag+with+space,',
]);
{
"status": 1,
"message": "Tag was added successfully",
"subscriber_uid": "5fd07ca421da0",
"tags": ["foo","bar","tag with space"]
}
Subscribe
Add a subscriber to a list identified by a UID
. Once added, the subscriber's status would be either pending
. This also triggers a confirmation email sending to the subscriber's email address for verification.
Parameters
curl -X PATCH -H "accept:application/json" -G \
http://acelle.wsl/api/v1/lists/{list_uid}/subscribers/{uid}/subscribe \
-d api_token=*|token_string|*
$client = new Acelle\Client(
'http://acelle.local/api/v1',
'*|api_token|*'
);
$client->list()->subscribe($uid = 'e31046fce3d83', $subscriber_uid = '6292e06666859');
{
"status": 1,
"message": "Subscriber was subscribed"
}
Unsubscribe
Unsubscribe a contact from a given list. Notice that the contact is still available in the list but of unsubscribed
status and Acelle will no longer send marketing emails to this contact. You can completely delete the contact from the list using the DELETE
API method.
Parameters
curl -X PATCH -H "accept:application/json" -G \
http://acelle.wsl/api/v1/lists/{list_uid}/subscribers/{uid}/unsubscribe \
-d api_token=*|token_string|*
$client = new Acelle\Client(
'http://acelle.local/api/v1',
'*|api_token|*'
);
$client->list()->unsubscribe($uid = 'e31046fce3d83', $subscriber_uid = '6292e06666859');
{
"status": 1,
"message": "Subscriber was unsubscribed"
}
Remove Subscriber
Remove a subscriber from a list and completely erase the subscriber's information in the web platform.
Parameters
curl -X DELETE -H "accept:application/json" -G \
http://acelle.wsl/api/v1/subscribers/{uid} \
-d api_token=*|token_string|*
$client = new Acelle\Client(
'http://acelle.local/api/v1',
'*|api_token|*'
);
$client->subscriber()->delete('e31046fce3d83');
{
"status": 1,
"message": "Deleted"
}
Campaigns
An email marketing campaign is a coordinated set of individual email messages that are deployed across a specific period of time with one specific purpose. These specific purposes or calls-to-action (CTAs) can include the following: download a white paper, sign up for a webinar, or make a purchase. Acelle allows you to create a marketing campaign targeting one or more lists of your audience. You can also set up a campaign that targets a segment of a given list, rather than the entire list
IMPORTANT: as of version 1.0
, Acelle API for campaigns is limited to READ ONLY methods. For setting up and running a campaign, users will need to login to the web UI.
List Campaigns
List all campaigns including new, running or closed ones.
Parameters
curl -X GET -H "accept:application/json" -G \
http://acelle.wsl/api/v1/campaigns \
-d api_token=*|token_string|*
$client = new Acelle\Client(
'http://acelle.local/api/v1',
'*|api_token|*'
);
$client->campaign()->all();
[
{
"uid":"5fb48ff221b27",
"name":"My Awesome Campaign",
"type":"regular",
"subject":"An Awesome Subject",
"html":"<!DOCTYPE html>\n<html lang=\"en\">\n...",
"plain": "One column layout...",
"from_email": "marketing@acelle.com",
"from_name":"No Reply",
"reply_to":"support@acelle.com",
"status":"new",
"delivery_at":null,
"created_at":"2021-11-18 03:07:30",
"updated_at":"2021-11-18 03:07:41"
},
...
]
Get Campaign's Details
Get detailed information and statistics of a campaign identified by a UID
code.
Parameters
curl -X GET -H "accept:application/json" -G \
http://acelle.wsl/api/v1/campaigns/{uid} \
-d api_token=*|token_string|*
$client = new Acelle\Client(
'http://acelle.local/api/v1',
'*|api_token|*'
);
$client->campaign()->find('5fb48ff221b27');
{
"campaign": {
"uid":"5fb48ff221b27",
"name":"Untitled",
"list":"",
"segment":"",
"default_subject":null,
"from_email":"marketing@acelle.com",
"from_name":"Marketing Department",
"remind_message":null,
"status":"new",
"created_at":[],
"updated_at":[]
},
"statistics": {
"subscriber_count":4,
"uniq_open_rate":0,
"delivered_rate":0,
"open_count":0,
"uniq_open_count":0,
"last_open":"",
"click_rate":0,
"click_per_uniq_open":0,
"click_count":0,
"abuse_feedback_count":0,
"last_click":"",
"bounce_count":0,
"unsubscribe_count":0,
"links":[],
"top_locations":[],
"top_open_subscribers":[]
}
}
Pause a Campaign
Pause a running campaign. You can later on run the campaign again to have it resume from where it left off.
Parameters
curl -X GET -H "accept:application/json" -G \
http://acelle.wsl/api/v1/campaigns/{uid}/pause \
-d api_token=*|token_string|* \
-d uid=*|uid|*
$client = new Acelle\Client(
'http://acelle.local/api/v1',
'*|api_token|*'
);
$client->campaign()->pause('6006510d1d421');
{
"status": "success",
"message": "The campaign was paused",
"campaign": {
"uid": "6006510d1d421",
"name": "Copy of Untitled",
"list": "",
"segment": "",
...
}
}
Notifications
Acelle Notification API is also referred to as Web Hooks, allowing 3rd delivery service or application (like PowerMTA, Postfix, Exim...) to send a delivery or abuse report to Acelle for a given transaction which could be a success / bounce / feedback or abuse report
Parameters
curl -X GET -H "accept:application/json" -G \
http://acelle.wsl/api/v1/notifications \
-d api_token=*|token_string|* \
-d type=sent
$client = new Acelle\Client(
'http://acelle.local/api/v1',
'*|api_token|*'
);
$client->notification()->read([
'type' => 'sent',
'message_id' => '201637442604422402.6199642caf7f3',
]);
curl -X GET -H "accept:application/json" -G \
http://acelle.wsl/api/v1/notifications \
-d api_token=*|token_string|* \
-d type=bounced \
-d bounced_type=hard \
-d description=Email+address+does+not+exist
$client = new Acelle\Client(
'http://acelle.local/api/v1',
'*|api_token|*'
);
$client->notification()->read([
'type' => 'bounced',
'message_id' => '201637442604422402.6199642caf7f3',
'bounced_type' => 'hard',
]);
curl -X GET -H "accept:application/json" -G \
http://acelle.wsl/api/v1/notifications \
-d api_token=*|token_string|* \
-d type=abuse \
-d report_type=hard \
-d description=Email+address+does+not+exist
$client = new Acelle\Client(
'http://acelle.local/api/v1',
'*|api_token|*'
);
$client->notification()->read([
'type' => 'abuse',
'message_id' => '201637442604422402.6199642caf7f3',
'report_type' => 'hard',
]);
{
"message": "Comming..."
}
Files
Every user or customer account has its own storage folder in Acelle platform. You can upload assets (images, video, other file types, etc.) to the customer or user's storage via API. These assets will be then added or attached to the user's email content.
Parameters
curl -X GET -H "accept:application/json" -G \
http://acelle.wsl/api/v1/file/upload \
-d api_token=*|token_string|* \
-d files='[{"url":"http://demo.acellemail.com/images/logo_big.svg","subdirectory":"path/to/file"},{"url":"http://demo.acellemail.com/images/logo_big.svg"}]","subdirectory":"path/to/file2"}]'
$client = new Acelle\Client(
'http://acelle.local/api/v1',
'*|api_token|*'
);
$client->file()->upload([
'files' => '[{"url":"http://demo.acellemail.com/images/logo_big.svg","subdirectory":"path/to/file"},{"url":"http://demo.acellemail.com/images/logo_big.svg","subdirectory":"path/to/file2"}]',
]);
[
{
"file": "http:\/\/demo.acellemail.com\/images\/logo_big.svg",
"status": 1,
"message": "File uploaded"
},
{
"file": "http:\/\/demo.acellemail.com\/images\/logo_big.svg",
"status": 1,
"message": "File uploaded"
}
]
Understanding of Service Plans and Subscription
Acelle is pre-designed as an SAAS (Software as a service) platform, allowing you to host it under your brand and charge your users for registering and using its features. When you start your hosting reselling business, you should define how you will offer your hosting resources and services to customers. Acelle lets you organize your business by means of service plans and subscriptions.
A service plan is a combination of hosting resources that you sell to your customers. For example, a plan can provide customers with the contacts/lists management service, a maximum of 100,000 contacts stored on the server, and 1 million email sending credits each month.
List Plans
List all plans available
Parameters
curl -X GET -H "accept:application/json" -G \
http://acelle.wsl/api/v1/login-token \
-d api_token=*|token_string|*
$client = new Acelle\Client(
'http://acelle.local/api/v1',
'*|api_token|*'
);
$client->plan()->all();
[
{
"uid":"58bd48f91fcab",
"name":"Free",
"price":"0.00",
"currency_code":"USD",
"frequency_amount":"1",
"frequency_unit":"month",
"options": {
"email_max":"5000",
"list_max":"10",
"subscriber_max":"1000",
"subscriber_per_list_max":"-1",
"segment_per_list_max":"3",
"campaign_max":"20",
"automation_max":"10",
"billing_cycle":"monthly",
"sending_limit":"1000_per_hour",
"sending_quota":1000,
"sending_quota_time":1,
"sending_quota_time_unit":"hour",
"max_process":"1",
"all_sending_servers":"yes",
"max_size_upload_total":"500",
"max_file_size_upload":"5",
"unsubscribe_url_required":"yes",
"access_when_offline":"no",
"create_sending_domains":"no",
"sending_servers_max":"-1",
"sending_domains_max":"-1",
"all_email_verification_servers":"yes",
"create_email_verification_servers":"no",
"email_verification_servers_max":"-1",
"list_import":"yes","list_export":"yes",
"all_sending_server_types":"yes",
"sending_server_types": {
"amazon-smtp":"yes",
"amazon-api":"yes",
"sendgrid-smtp":"yes",
"sendgrid-api":"yes",
"mailgun-api":"yes",
"mailgun-smtp":"yes",
"elasticemail-api":"yes",
"elasticemail-smtp":"yes",
"sparkpost-api":"yes",
"sparkpost-smtp":"yes",
"smtp":"yes",
"sendmail":"yes",
"php-mail":"yes"
},
"sending_server_option":
"system",
"sending_server_subaccount_uid":null,
"api_access":"yes",
"email_footer_enabled":"yes",
"email_footer_trial_period_only":"no",
"html_footer":"",
"plain_text_footer":"",
"payment_gateway":""
},
"status":"active",
"color":"#008c6e",
"quota":null,
"custom_order":"1",
"created_at":[],
"updated_at":[]
},
...
]
Create Plan
Create a service plan and make it available for users to subscribe. You can also specify the plan's quota settings and many attributes at creation time.
Parameters
curl -X POST -H "accept:application/json" -G \
http://acelle.wsl/api/v1/login-token \
-d api_token=*|token_string|* \
-d name=Advanced \
-d currency_id=1 \
-d frequency_amount=1 \
-d frequency_unit=month \
-d price=20 \
-d color=red \
-d options[sending_server_option]=own \
-d options[email_max]=10000
$client = new Acelle\Client(
'http://acelle.local/api/v1',
'*|api_token|*'
);
$client->plan()->create([
'name' => 'Advanced',
'currency_id' => '1',
'frequency_amount' => '1',
'frequency_unit' => 'month',
'price' => '20',
'color' => 'red',
'options[sending_server_option]' => 'own',
'options[email_max]' => '10000',
]);
{
"status": 1,
"message": "Plan was successfully created",
"plan_uid": "5fd08d2ed4cc8"
}
List Sending Servers
A sending server in Acelle is actually a connection to a sending server or service. Normally, it is an SMTP server which actually delivers marketing emails. You can configure Acelle to sends email through a remote SMTP server or a local mailer program installed in the hosting server itself. Acelle currently does not support creating a sending server via API, you may want to login to the web UI to do it. However, you can list all available sending servers in the system using API.
Parameters
curl -X GET -H "accept:application/json" -G \
http://acelle.wsl/api/v1/sending_servers \
-d api_token=*|token_string|*
$client = new Acelle\Client(
'http://acelle.local/api/v1',
'*|api_token|*'
);
$client->sending_server()->all();
[
{
"uid":"5fc273b9ded36",
"name":"Amazon API",
"created_at":"2020-11-28 15:58:49",
"updated_at":"2020-11-28 15:58:53"
}
]
Customers
In Acelle, customers sign up against the web application to create an account and subscribe to a service plan (free, standard, premium... for example) then pay for it in order to use the system's functionality. Acelle API allows you to manage your customers and subscriptions which is helpful when you use Acelle with another application or system.
Create Customer
Create a new customer account. You can later on subscribe the newly created customer to a plan using PLAN
api.
Parameters
curl -X POST -H "accept:application/json" -G \
http://acelle.wsl/api/v1/customers \
-d api_token=*|token_string|* \
-d email=user_name@gmail.com \
-d first_name=Luan \
-d last_name=Pham \
-d timezone=America/Godthab \
-d language_id=1 \
-d password=123456
$client = new Acelle\Client(
'http://acelle.local/api/v1',
'*|api_token|*'
);
$client->customer()->create([
'email' => 'user_namexx@gmail.com',
'first_name' => 'Luan',
'last_name' => 'Pham',
'timezone' => 'America/Godthab',
'language_id' => '1',
'password' => '123456',
]);
{
"status": 1,
"message": "Customer was successfully created",
"customer_uid": "5fd093b62ea11",
"api_token": "fPBMSHhY95mnj8sZBbNALYQe611hSO4CqcOOX4KI0TZSK2Py3gUtVUHYNH8a"
}
Get Customer's Details
Get detailed information of a customer identified by a UID
code
Parameters
curl -X GET -H "accept:application/json" -G \
http://acelle.wsl/api/v1/customers/{uid} \
-d api_token=*|token_string|*
$client = new Acelle\Client(
'http://acelle.local/api/v1',
'*|api_token|*'
);
$client->customer()->find('5fd1a0097ce01');
{
"customer": {
"uid": "5fd093b62ea11",
"first_name": "Luan",
"last_name": "Pham",
"image": null,
"timezone": "America\/Godthab",
"status": "active",
"options": [],
"current_period_ends_at": null
}
}
Update Customer
Update a customer's attributes, identified by a UID
code
Parameters
curl -X PATCH -H "accept:application/json" -G \
http://acelle.wsl/api/v1/customers/{uid} \
-d api_token=*|token_string|* \
-d email=user_name@gmail.com \
-d first_name=Luan \
-d last_name=Pham \
-d timezone=America/Godthab \
-d language_id=1 \
-d password=123456
$client = new Acelle\Client(
'http://acelle.local/api/v1',
'*|api_token|*'
);
$client->customer()->update('5fd1a0097ce01', [
'email' => 'user_namexx@gmail.com',
'first_name' => 'Luan',
'last_name' => 'Pham',
'timezone' => 'America/Godthab',
'language_id' => '1',
'password' => '123456',
]);
{
"customer": {
"uid": "5fd093b62ea11",
"first_name": "Luan",
"last_name": "Pham",
"image": null,
"timezone": "America\/Godthab",
"status": "active",
"options": [],
"current_period_ends_at": null
}
}
Enable Customer
Enable a customer if the customer was previously disabled.
Parameters
curl -X PATCH -H "accept:application/json" -G \
http://acelle.wsl/api/v1/customers/{uid}/enable \
-d api_token=*|token_string|*
$client = new Acelle\Client(
'http://acelle.local/api/v1',
'*|api_token|*'
);
$client->customer()->enable('5fd1a0097ce01');
{
"status": 1,
"message": "Customer was enabled",
"customer_uid": "5fd093b62ea11"
}
Disable Customer
Disable a Customer, preventing the Customer from logging to the application.
Parameters
curl -X PATCH -H "accept:application/json" -G \
http://acelle.wsl/api/v1/customers/{uid}/disable \
-d api_token=*|token_string|*
$client = new Acelle\Client(
'http://acelle.local/api/v1',
'*|api_token|*'
);
$client->customer()->disable('5fd1a0097ce01');
{
"status": 1,
"message": "Customer was disabled",
"customer_uid": "5fd093b62ea11"
}
Assign Plan
Assign a plan to a customer. In other words, subscribe a user to a plan. Then the customer will then be able to login to the application and proceed with paying for the plan. If the plan is free, then the user is subscribed and can immediately use the features.
Parameters
curl -X POST -H "accept:application/json" -G \
http://acelle.wsl/api/v1/customers/{uid}/assign-plan/{plan_uid} \
-d api_token=*|token_string|*
$client = new Acelle\Client(
'http://acelle.local/api/v1',
'*|api_token|*'
);
$client->customer()->assignPlan('5fd1a0097ce01', '5fd1a16fb8f27');
{
"status": 1,
"message": "Customer was assigned to plan",
"customer_uid": "5fd093b62ea11"
}
Subscriptions
Manage user subscriptions to plans. You can create a new subscription, activate a pending subscription or cancel a subscription.
Normally, users can sign up to the system, subscribe to a plan and proceed with the payment.
The API is helpful in case you want to quickly assign a plan to a user.
Create a subscription
List all subscriptions from application.
Parameters
curl -X GET -H "accept:application/json" -G \
http://acelle.wsl/api/v1/subscriptions \
-d api_token=*|token_string|* \
-d per_page=20 \
-d plan_uid=1
$client = new Acelle\Client(
'http://acelle.local/api/v1',
'*|api_token|*'
);
$client->subscription()->all([
'per_page' => '25',
'page' => '1',
]);
[
{
"id": 1,
"uid": "5fade5c93e42a",
"customer_id": "23",
"plan_id": "8",
"status": "ended",
"current_period_ends_at": null,
"ends_at": "2021-11-13 01:47:53"
},
{
"id": 2,
"uid": "5fc9e55410e10",
...
},
...
]
Create a subscription
Assign a plan to a customer. In other words, subscribe a user to a plan. Then the customer will then be able to login to the application and proceed with paying for the plan. If the plan is free, then the user is subscribed and can immediately use the features.
Parameters
curl -X POST -H "accept:application/json" -G \
http://acelle.wsl/api/v1/customers/{uid}/assign-plan/{plan_uid} \
-d api_token=*|token_string|*
$client = new Acelle\Client(
'http://acelle.local/api/v1',
'*|api_token|*'
);
$client->customer()->assignPlan('5fd1a0097ce01', '5fd1a16fb8f27');
{
"status": 1,
"message": "Customer was assigned to plan",
"customer_uid": "5fd093b62ea11"
}