Here are the key features of Mailster Rest API Plugin
- Get Campaigns details
- Create Campaign
- Get All Subscribers
- Create Subscribers
- Search Subscribers
- Get All List details
- Get Single List details
Please include Basic Authentication in the header of your request to retrieve the data.
Get All Campaigns: http://siteurl/wp-json/wp/v2/wpo_mailster_campaign
Campaign Post request sample data
{ "title": "Lorem Ipsum", "content": "HTML Template Contnet goes here", "status": "autoresponder", //[active/queued/paused/autoresponder] "meta_data": { "_mailster_from_name": "Name", "_mailster_from_email": "From Email", "_mailster_reply_to": "Reply Email", "_mailster_subject": "Email Subject", "_mailster_timestamp": "2018-08-09 10:49:33", "_mailster_template":"mymail", "_mailster_colors": { "#F3F4F4": "#F3F4F4", "#585858": "#585858", "#5CA8CD": "#5CA8CD", "#FFFFFF": "#FFFFFF", "#E1E1E1": "#E1E1E1", "#EFEFEF": "#EFEFEF", "#FEFEFE": "#FEFEFE" }, "_mailster_preheader": "Text will show before Header", "_mailster_lists": ["45","39"], //[Mailster List IDs] "_mailster_attachments":[ "https://wpintegrate.com/demo.jpg", "https://wpintegrate.com/wp-content/uploads/2016/05/newsletter_full_img.png" ], /*Auto responder Data*/ "_mailster_active":"1", "_mailster_autoresponder":{ "amount":"1", "unit":"day", "before_after":1, "action":"mailster_subscriber_unsubscribed", "post_type":"post", "post_count":"0", "interval":"1", "time_frame":"day", "weekdays":[ "1","2","4","0" ], "time_post_count":"1", "time_post_type":"post", "issue":"1", "post_count_status":"0", "userexactdate":"0", "useramount":"1", "userunit":"day", "uservalue":"-1", "followup_action":1, "hook":"", "priority":10 } /*Auto responder Data*/ } }
Create Subscribers: http://siteurl/wp-json/wp/v2/wpo_mailster
Post request sample data
{ "firstname":"John", "lastname": "Doe", "email":"[email protected]", "list_ids":[37,49] }
Get All Subscribers: http://siteurl/wp-json/wp/v2/wpo_mailster
To filter the Subscribers use conditions parameter array http://siteurl/wp-json/wp/v2/wpo_mailster?conditions[0][field]=lastname&conditions[0][operator]=^&conditions[0][value]=r
field, operator, value
- field : In Which field you want to search like firstname, lastname, email
- operator
=
(Is equal)
!=
(Is not equal)
<>
(Contain certain character(s))
!<>
(Does not contain certain character(s))
^
(Starts with certain character(s))
$
(Ends with certain character(s))
>=
(Is greater or equal)
<=
(Is smaller or equal)
>
(Is greater)
<
(Is smaller)
value: Search Keyword
limit, lists (List IDs comma separated), offset, orderby (ID, email, wp_id, added, updated, signup), order(asc or desc)
Get All List details : http://siteurl/wp-json/wp/v2/wpo_mailster_lists
Get Single List details : http://siteurl/wp-json/wp/v2/wpo_mailster_lists/1 (Replace 1 with desired list ID.)
Add List : http://siteurl/wp-json/wp/v2/wpo_mailster_lists
Data:
{ "name": "List test21", "description":"Product Sales3", "parent_id":"61" }
To update the list details, add list ID like this : http://siteurl/wp-json/wp/v2/wpo_mailster_lists/1