The following section explains retrieving total number of custom fields from the MUMARA; subsequent sample request demonstrates retrieving of the custom fields and returning of the obtained data in Json format.
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) |
You just need to provide correct MUMARA username, API and path. There is no other field requirement in case of sending Get Custom Field API request.
Following Get Custom Fields request set to retrieve all custom fields set within the provided MUMARA account, the following sample request will retrieve custom fields from Custom Field ID "1" to Custom Field ID "8"
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL,'http://www.yourdomain.com/API/getCustomFields');
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);
}
Upon submitting valid Get Custom Fields request, you will get the following Json response.
Status value for successfully getting all custom fields will be- “success”
Data Returned- Custom Field ID, Field Name, Field Type, Field Order, Field Value, Date of Creation
{"status":"success", "response":[{"custom_field_id":"1", "field_name":"Gender ", "field_type":"checkbox", "is_required":"1", "value_list":"Male\r\nFemale ", "field_order":"1", "create_date":"2014-11-30"},{"custom_field_id":"2", "field_name":"Birthplace", "field_type":"text", "is_required":"0", "value_list":"", "field_order":"3", "create_date":"2014-11-30"},{"custom_field_id":"3", "field_name":"Designation ", "field_type":"text", "is_required":"0", "value_list":"", "field_order":"2", "create_date":"2014-11-30"},{"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"},{"custom_field_id":"6", "field_name":"gender", "field_type":"checkbox", "is_required":"", "value_list":"", "field_order":"0", "create_date":"2015-11-04"},{"custom_field_id":"8", "field_name":"gender", "field_type":"checkbox", "is_required":"", "value_list":"", "field_order":"0", "create_date":"2015-11-04"}]}
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