This function would help you to retrieve custom fields in a particular list using API service request. The following section will explain the process of retrieving custom fields of particular list from MUMARA, by using a sample API request.
Username |
The email that account holder uses to login MUMARA |
API Token |
The API token user has generated using API Configuration section of MUMARA, also mentioned above. |
Method |
Method being called (Post) |
Path |
Path to the API file being called ('http//www.yourdomain.com/API/deleteSubscriber) |
Label |
Priority |
Description |
list_id |
Required |
List ID is required in order to retrieve custom fields from it. |
Sample Get List Custom Fields request retrieves custom fields and returns obtained data in Json format. Sample request for list ID “4” is as follows.
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL,'http://www.yourdomain.com/API/getListCustomFields?list_id=4');'
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_TIMEOUT, 60);
curl_setopt($ch, CURLOPT_HTTPHEADER, array( 'APIToken: 343b1b831067b50e308e6bf93e0f06f0', 'Login: [email protected]'));
$data = curl_exec($ch);
if (curl_errno($ch)) {
print "Error: " . curl_error($ch);
} else {
// Show me the result
print ($data);
curl_close($ch);
}
You will get the following response upon submitting appropriate request and correct ID of the particular list you want to get Custom Fields of.
Status value for successfully getting custom fields of particular list will be- “success”
Data Returned- Custom Filed ID, Field Name, Field Type, List Value, Field Order, Date of Creation
{"status":"success", "response":[{"custom_field_id":"4", "field_name":"Country One", "field_type":"select", "is_required":"1", "value_list":"Canada \r\nUS\r\nPakistan ", "field_order":"4", "create_date":"2014-12-23"},{"custom_field_id":"5", "field_name":"Joining Date", "field_type":"date", "is_required":"1", "value_list":"", "field_order":"1", "create_date":"2015-09-18"}]}
When you submit request with inappropriate, incorrect information.
Status value for unsuccessful submission will be-"error”
Data Returned- Text based message describing reason of unsuccessful response