API Guide Lists
Tab 2
Tab 3

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.

LilyPostbox'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 everymail 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
api_token string Your API token.
You can find it in your API main page when logged in.

VIEW LISTS              

12345$client = newLilyPostbox\Client(    'http://App.lilypostbox.com/api/v1',    '*|api_token|*');$client->list()->all();RESPONSE[    {        "id": 1,        "uid": "5fade5c93e42a",        "name": "My AwesomeCampaign",        "default_subject": "AnAwesome Subject",        "from_email": "support@App.lilypostbox.com",        "from_name": "CustomerSupport",        "status":null,        "created_at": "2021-11-1301:47:53",        "updated_at": "2021-12-0407:29:24"    },    {        "id": 2,        "uid": "5fc9e55410e10",        "name": "List 1",        ...    },    ...]

Create List

A mail list is a collection of email addressesused by an individual or an organization to send marketing material to multiplerecipients. You can have different lists of different group of contactsMake a POST request to the /list resource along with your desired listdetails to create. On success, a unique List UID key is returned for the newly createdlist, which is used as a reference key for interacting with it.

Parameters
api_token stringYour API token. You can findit in your API main page when logged in.
name stringList's name
from_email emailDefault From email address
from_name stringDefault From name
default_subject stringDefault email subject
contact[company] stringCompany name
contact[state] stringState / Province / Region
contact[address_1] stringAddress 1
contact[address_2] stringAddress 2
contact[city] stringCity
contact[zip] stringZip / Postal code
contact[phone] stringPhone
contact[country_id] stringCountry id
contact[email] emailEmail
contact[url] urlHome page
subscribe_confirmation stringSend subscriptionconfirmation email (Double Opt-In)
send_welcome_email stringSend a final welcome email
unsubscribe_notification stringSend unsubscribenotification to subscribers
send_welcome_email stringSend a final welcome email

CREATE NEW LIST                       

12345678910111213141516171819202122232425$client = newLilyPostbox\Client(    'http://App.lilypostbox.com/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',]);RESPONSE{    "status": 1,    "message": "List wassuccessfully created",    "list_uid": "5fc9e55410e10"}Get List DetailsGet detailed information of a List identifiedby a given UID passedto the API call.Parametersapi_token stringYour API token. You can findit in your API main page when logged in.uid stringList's uidFIND LIST                cURL                PHP                            cURL                PHP            12345$client = newLilyPostbox\Client(    'http://App.lilypostbox.com/api/v1',    '*|api_token|*');$client->list()->find('*|uid|*');RESPONSE{    "list": {        "uid": "5fc9e55410e10",        "name": "List 1",        "default_subject": "Welcometo ABC Corp.",        "from_email": "admin@abccorp.org",        "from_name": "ABCCorp.",        "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": "ABCCorp.",        "address_1": "14Tottenham Court Road London England",        "address_2": "44-46Morningside Road Edinburgh Scotland EH10 4BF",        "country": "Afghanistan",        "state":"Armagh",        "zip": "80000",        "phone": "123 456889",        "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 FieldBeside common fields of a contact like emails,names, addresses, cellphone numbers, etc. You can add customized fields to yourmail lists to store more information about your list's contacts such as theirpreferences, scores, etc. and then you can organize contacts based on specificinterest groups within your list/audience.Parametersapi_token stringYour API token. You can findit in your API main page when logged in.type stringChoose one of these types:text, number, datetime.label stringField' labeltag stringThe tag name may havealpha-numeric characters, as well as dashes and underscores.default_value stringDefault value of the fieldVIEW LISTS                cURL               PHP                             cURL               PHP             12345678910$client = newLilyPostbox\Client(    'http://App.lilypostbox.com/api/v1',    '*|api_token|*');$client->list()->addCustomField('5fd18406c7b1d',[    'type' => 'text',    'label' => 'Custom',    'tag' => 'CUSTOM_FIELD_1',    'default_value' => 'test',]);RESPONSE{    "status": 1,    "message": "List's field wascreated",    "field": {        "mail_list_id": 2,        "type": "text",        "label": "Custom",        "tag":"CUSTOM_FIELD_1",        "default_value":"test",        "uid":"5fcae3cb6298f",        "updated_at":"2020-12-0501:35:07",        "created_at":"2020-12-0501:35:07","id":7    }}Delete ListDelete a list and completely erase the list'sinformation in the web platform.Parametersapi_token stringYour API token. You can findit in your API main page when logged in.uid stringList's uidDELETE LIST                cURL               PHP                             cURL               PHP             12345$client = newLilyPostbox\Client(    'http://App.lilypostbox.com/api/v1',    '*|api_token|*');$client->list()->delete('e31046fce3d83');RESPONSE{    "status": 1,    "message": "Deleted"}

12345$client = newLilyPostbox\Client(    'http://App.lilypostbox.com/api/v1',    '*|api_token|*');$client->list()->all();RESPONSE[    {        "id": 1,        "uid": "5fade5c93e42a",        "name": "My AwesomeCampaign",        "default_subject": "AnAwesome Subject",        "from_email": "support@App.lilypostbox.com",        "from_name": "CustomerSupport",        "status":null,        "created_at": "2021-11-1301:47:53",        "updated_at": "2021-12-0407:29:24"    },    {        "id": 2,        "uid": "5fc9e55410e10",        "name": "List 1",        ...    },    ...]