Knowledgebase

Get Custom Field

Make use of the following function to retrieve particular custom field from MUMARA using the API service request.

Required to Submit Json 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)

Field Details

Label/Variable

Priority

Description

custom_field_id

Required

Custom Field ID is required in order to retrieve particular Custom Field.

Sample Request

Sample Get Custom Field request retrieves particular custom field with its ID and returns obtained data in Json format.  Sample request for the custom field with ID “4” is as follows.

$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, CURLOPT_URL,'http://www.yourdomain.com/API/getCustomField?custom_field_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);
}

Success Response

You will get the following response upon submitting appropriate request and correct ID of the particular list you want to retrieve from MUMARA.

Status value for successfully getting custom field will be- “success”
Data Returned- Custom Field ID, Field Name, Field 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"}]}

Erroneous Response

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