Make use of API function to retrieve the custom fields belonging to specific list. Here is how it works.
Variable |
Description |
$id |
$id here refers to List ID to retrieve custom fields belonging to that specific list. To know the id of particular list you want to retrieve the custom fields of, go to View Lists page and click Edit from the Actions. The Edit page URL has the list ID and it appears like my.mumara.host/list/4/edit, in this URL 4 is the list ID. |
<?php
$api_token = 'xxxxxxxxxxxxxxxxxxxxxxxxxx';
$id = 5;
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL,"http://sampledomain.com/api/getListCustomFields/$id");
curl_setopt($ch, CURLOPT_HTTPHEADER,
array('Content-Type: application/json', 'Authorization: Bearer ' . $api_token));
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
$output = curl_exec ($ch);
print_r($output);
curl_close ($ch);
?>
Successfully posted API call will return the information related to the custom fields that belong to the list-id you have provided, information would include Custom Filed ID, Field Name, Field Type, List Value, Field Order, Date of Creation
In case of providing a wrong list ID or list ID that doesn't exist at all, the error response will appear that follows a pattern in almost all the API responses.