Want to retrieve all the contacts/subscribers of specific list? Make use of the following API call.
Required Parameters to Submit Request
- API Token- Token that you have generated using generate API token. Make sure you are using the most recent one.
- End Point- End point for the Add List API would appear http://my.mumara.com/api/getSubscribers . It represents your instance of CampaignsPlus, along with the function name you are requesting through API
Method (GET)
Required to Get Contacts
list_id |
Providing ID of specific list is required to retrieve the contact information from it. |
Subscriber Count
There is an additional variable that you can use to put forward a subscriber count you want to retrieve from the list. start=0&records=4 are the variables that you can provide to retrieve contact from 0 to 4 from the specific list, it can be like start=150&records=220 to retrieve contacts from 150 to 220 contacts. By default it is set to retrieve contacts from 0 to 500.
Sample Request
<?php $ch = curl_init(); curl_setopt($ch, CURLOPT_URL,"http://my.mumara.host/api/getSubscribers?api_token=xxxxxxxxxxxxxxxxxx&list_id=3&start=150&records=220"); curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); $output = curl_exec ($ch); print_r($output); curl_close ($ch); ?>
Success Response
Upon submitting a successful API request, you will be able to retrieve the contact's information from the specific list you have mentioned with its ID in the API Curl Request. Information such as their emails, information stored within additional fields, their confirmation status, bounce, unsubscribe status etc.
Note: This function wouldn't retrieve information from the custom fields, for that you would need to use another function.
{"status":"success","response":"Subscriber Data"}
Error Response
{"status":"error","response":"list_id not found"}
Comments
0 comments
Please sign in to leave a comment.
Article Path: /hc/en-us/articles/360002093112-Get-Subscribers-Contacts-API
Article Title: Get Subscribers/Contacts-API