I just started looking at the API and found the aFields is perfect for my needs. In this particular survey, I have equation questions that score questions based on my algorithm and store the response accordingly. Using the API, I retrieve the computed results:
Code:
$sDocumentType = 'json'; //pdf, csv, xls, doc, json
$sLanguageCode = 'en';
$sCompletionStatus = 'complete'; // 'incomplete' or 'all' -- default: 'all'
$sHeadingType = 'code'; // 'full' or 'abbreviated' -- default: 'code'
$sResponseType = 'short'; // or 'long' -- default: 'short'
$iFromResponseID = 10;
$iToResponseID = 18; //(see get_response_ids() for range of possible ids)
$aFields = array( 'id', '171768X29X1042','submitdate', '171768X7X42', '171768X7X44', '171768X7X45', '171768X7X1257', '171768X7X1258', '171768X7X1259', '171768X7X1260', '171768X7X1261', '171768X7X1262' );
$responses = $myJSONRPCClient->export_responses(
$sSessionKey, $sid, $sDocumentType, $sLanguageCode, $sCompletionStatus,
$sHeadingType, $sResponseType, $iFromResponseID, $iToResponseId, $aFields);
// convert and echo to screen to review
$strDecoded = base64_decode( $responses );
$res_json = json_decode($strDecoded);
echo '<pre>';
print_r($res_json);
echo '</pre>';
The only issue I'm having is the $iFromResponseID and $iToResponseID don't actually filter the results...I get all of the completed surveys.
At any rate, just include the SQGA fields in an array and you should be able to get a nice concise report.