I have drupal 7 deployment with services 3 module. I have Services with JSON output configured. When I get my results, the custom fields return labels instead of the actual field names. For example, Node Title which is built in shows node_title. However, 1 Year a custom field that was stored as field_1_year shows up as 1 Year. This makes it difficult to parse JSON. Any suggestions?
You can make your custom json feed i.e.:
Make you php script and at top add standard D7 bootstrap:
define('DRUPAL_ROOT', getcwd());
require_once DRUPAL_ROOT . '/includes/bootstrap.inc'; drupal_bootstrap(DRUPAL_BOOTSTRAP_FULL);
After this code you'll have all Drupal's functionalities available in your script.
https://api.drupal.org/api/views/views.module/function/views_get_view_result/7
Then iterate trough your results and create another php array containing values you want in the way you want.
Use json_encode to convert your array to json string: http://php.net/manual/en/function.json-encode.php
Print out your json string. You can even print out json header before it, so apps that are getting feed will know it's json (sometime may be needed)
header('Content-Type: application/json');
Something like that...