AnsweredAssumed Answered

Error getting value using PHP and Data API

Question asked by stephensexton on Jul 16, 2018
Latest reply on Jul 16, 2018 by mdenyse

I am having difficulty setting a variable from a response to a Data API call (FMS17) with PHP.

The difficulty relates to a value from a related table, examples and outcomes below after setting curl options :


$appts_available = curl_exec($c_appts);

$display_appts = json_decode($appts_available);

$message_appts = $display_appts->messages[0]->code; //returns '0' ok


$RecordUUID = $display_appts->response->data[0]->fieldData->RecordUUID; //this was ok

$recordId = $display_appts->response->data[0]->recordId; //this was ok


$namereference = $display_appts->response->data[0]->fieldData->OBUsers_Events::NameReference;// NO GOOD

*** Agghhh!  $namereference fails (note that the key is from a related table).


- The field "OBUsers_Events::NameReference" is displayed on the layout that was specified in the "_find" url

- The relevant key/value pair was returned as expected in $appts_available

- I could get this value using Postman, but not in my php page.


Can anyone help me with the correct syntax for this situation (getting value from related table)?


Any tips would be much appreciated.