├── README.md ├── SurveyMonkey.class.php └── tests └── all_methods.php /README.md: -------------------------------------------------------------------------------- 1 | PHP class for SurveyMonkey API 2 | ============================== 3 | 4 | 5 | Basic usage 6 | ---- 7 | ``` 8 | $SM = new SurveyMonkey("myApiKey" , "myAccessToken"); 9 | $result = $SM->getSurveyList(); 10 | if ($result["success"]) print_r( $result["data"]["surveys"] ); 11 | else print_r($result["message"]); // Print out the error message 12 | ``` 13 | 14 | All methods return an array containing a **success** boolean, and the **data** -or- an error **message** 15 | 16 | Advanced 17 | ---- 18 | ``` 19 | $SM = new SurveyMonkey("myApiKey" , "myAccessToken", 20 | array( // Override default API options (quite useless at the moment) 21 | 'protocol' => 'http', // will not work.. they require SSL 22 | 'hostname' => 'fake-api.surveymonkey.net' // will also not work.. 23 | ), 24 | array( // CURL override options 25 | CURLOPT_SSL_VERIFYPEER => false // Better add cacert.pam, no? 26 | // ...... 27 | ) 28 | ); 29 | $result = $SM->getSurveyList(array( 30 | "fields" => array( 31 | "title", 32 | "analysis_url", 33 | "date_created", 34 | "date_modified", 35 | "question_count", 36 | "num_responses" 37 | ), 38 | 'page_size' => 50, 39 | 'page' => 2 40 | )); 41 | ``` 42 | 43 | All methods 44 | ---- 45 | 46 | **getSurveyList** 47 | ``` 48 | /** 49 | * Retrieves a paged list of surveys in a user's account. 50 | * @see https://developer.surveymonkey.com/mashery/get_survey_list 51 | * @param array $params optional request array 52 | * @return array Result 53 | */ 54 | public function getSurveyList($params = array()){} 55 | ``` 56 | 57 | **getSurveyDetails** 58 | ``` 59 | /** 60 | * Retrieve a given survey's metadata. 61 | * @see https://developer.surveymonkey.com/mashery/get_survey_details 62 | * @param string $surveyId Survey ID 63 | * @return array Results 64 | */ 65 | public function getSurveyDetails($surveyId){} 66 | ``` 67 | 68 | **getCollectorList** 69 | ``` 70 | /** 71 | * Retrieves a paged list of collectors for a survey in a user's account. 72 | * @see https://developer.surveymonkey.com/mashery/get_collector_list 73 | * @param string $surveyId Survey ID 74 | * @param array $params optional request array 75 | * @return array Results 76 | */ 77 | public function getCollectorList($surveyId, $params = array()){} 78 | ``` 79 | 80 | **getRespondentList** 81 | ``` 82 | /** 83 | * Retrieves a paged list of respondents for a given survey and optionally collector 84 | * @see https://developer.surveymonkey.com/mashery/get_respondent_list 85 | * @param string $surveyId Survey ID 86 | * @param array $params optional request array 87 | * @return array Results 88 | */ 89 | public function getRespondentList($surveyId, $params = array()){} 90 | ``` 91 | 92 | **getResponses** 93 | ``` 94 | /** 95 | * Takes a list of respondent ids and returns the responses that correlate to them. 96 | * @see https://developer.surveymonkey.com/mashery/get_responses 97 | * @param string $surveyId Survey ID 98 | * @param array $respondentIds Array of respondents IDs to retrieve 99 | * @param integer $chunkSize optional number of respondants to fetch in each chunk. We split it to multiple requests to conform with SurveyMonkey's API limits. If successful, the returned array is a joined array of all chunks. 100 | * @return array Results 101 | */ 102 | public function getResponses($surveyId, $respondentIds, $chunkSize = 100){} 103 | ``` 104 | 105 | **getResponseCount** 106 | ``` 107 | /** 108 | * Returns how many respondents have started and/or completed the survey for the given collector 109 | * @see https://developer.surveymonkey.com/mashery/get_response_counts 110 | * @param string $collectorId Collector ID 111 | * @return array Results 112 | */ 113 | public function getResponseCount($collectorId){} 114 | ``` 115 | 116 | **getUserDetails** 117 | ``` 118 | /** 119 | * Returns basic information about the logged-in user 120 | * @see https://developer.surveymonkey.com/mashery/get_user_details 121 | * @return array Results 122 | */ 123 | public function getUserDetails(){} 124 | ``` 125 | 126 | **getTemplateList** 127 | ``` 128 | /** 129 | * Retrieves a paged list of templates provided by survey monkey. 130 | * @see https://developer.surveymonkey.com/mashery/get_template_list 131 | * @param array $params optional request array 132 | * @return array Results 133 | */ 134 | public function getTemplateList($params = array()){} 135 | ``` 136 | 137 | **createCollector** 138 | ``` 139 | /** 140 | * Retrieves a paged list of templates provided by survey monkey. 141 | * @see https://developer.surveymonkey.com/mashery/create_collector 142 | * @param string $surveyId Survey ID 143 | * @param string $collectorName optional Collector Name - defaults to 'New Link' 144 | * @param string $collectorType required Collector Type - only 'weblink' currently supported 145 | * @param array $params optional request array 146 | * @return array Results 147 | */ 148 | public function createCollector($surveyId, $collectorName = null, $collectorType = 'weblink'){} 149 | ``` 150 | 151 | **createFlow** 152 | ``` 153 | /** 154 | * Create a survey, email collector and email message based on a template or existing survey. 155 | * @see https://developer.surveymonkey.com/mashery/create_flow 156 | * @param string $surveyTitle Survey Title 157 | * @param array $params optional request array 158 | * @return array Results 159 | */ 160 | public function createFlow($surveyTitle, $params = array()){} 161 | ``` 162 | 163 | **sendFlow** 164 | ``` 165 | /** 166 | * Create an email collector and email message attaching them to an existing survey. 167 | * @see https://developer.surveymonkey.com/mashery/send_flow 168 | * @param string $surveyId Survey ID 169 | * @param array $params optional request array 170 | * @return array Results 171 | */ 172 | public function sendFlow($surveyId, $params = array()){} 173 | ``` 174 | 175 | API version 176 | ----------- 177 | v2 178 | 179 | 180 | Tests 181 | ----- 182 | See /tests/all_methods.php 183 | 184 | 185 | License 186 | ---- 187 | **No** rights reserved. 188 | *Do whatever you want with it, It's free* 189 | -------------------------------------------------------------------------------- /SurveyMonkey.class.php: -------------------------------------------------------------------------------- 1 | = 200 and $code < 300){ 56 | return true; 57 | } 58 | return false; 59 | } 60 | /** 61 | * SurveyMonkey API Status code definitions 62 | */ 63 | public static $SM_STATUS_CODES = array( 64 | 0 => "Success", 65 | 1 => "Not Authenticated", 66 | 2 => "Invalid User Credentials", 67 | 3 => "Invalid Request", 68 | 4 => "Unknown User", 69 | 5 => "System Error", 70 | 6 => "Plan Limit Exceeded" 71 | ); 72 | 73 | /** 74 | * Explain Survey Monkey status code 75 | * @param integer $code Status code 76 | * @return string Definition 77 | */ 78 | public static function explainStatusCode($code){ 79 | return self::$SM_STATUS_CODES[$code]; 80 | } 81 | 82 | /** 83 | * The SurveyMonkey Constructor. 84 | * 85 | * This method is used to create a new SurveyMonkey object with a connection to a 86 | * specific api key and access token 87 | * 88 | * @param string $apiKey A valid api key 89 | * @param string $accessToken A valid access token 90 | * @param array $options (optional) An array of options 91 | * @param array $connectionOptions (optional) cURL connection options 92 | * @throws SurveyMonkey_Exception If an error occurs creating the instance. 93 | * @return SurveyMonkey A unique SurveyMonkey instance. 94 | */ 95 | public function __construct($apiKey, $accessToken, $options = array(), $connectionOptions = array()){ 96 | 97 | if (empty($apiKey)) throw new SurveyMonkey_Exception('Missing apiKey'); 98 | if (empty($accessToken)) throw new SurveyMonkey_Exception('Missing accessToken'); 99 | $this->_apiKey = $apiKey; 100 | $this->_accessToken = $accessToken; 101 | 102 | $this->_protocol = (!empty($options['protocol']))? $options['protocol'] : 'https'; 103 | $this->_hostname = (!empty($options['hostname']))? $options['hostname'] : 'api.surveymonkey.net'; 104 | $this->_version = (!empty($options['version']))? $options['version'] : 'v2'; 105 | 106 | $this->_connectionOptions = $connectionOptions; 107 | } 108 | 109 | /** 110 | * Build the request URI 111 | * @param string $endpoint API endpoint to call in the form: resource/method 112 | * @return string Constructed URI 113 | */ 114 | protected function buildUri($endpoint){ 115 | return $this->_protocol . '://' . $this->_hostname . '/' . $this->_version . '/' . $endpoint . '?api_key=' . $this->_apiKey; 116 | } 117 | 118 | /** 119 | * Get the connection 120 | * @return boolean 121 | */ 122 | protected function getConnection(){ 123 | $this->conn = curl_init(); 124 | return is_resource($this->conn); 125 | } 126 | 127 | /** 128 | * Close the connection 129 | */ 130 | protected function closeConnection(){ 131 | curl_close($this->conn); 132 | } 133 | 134 | /** 135 | * Run the 136 | * @param string $method API method to run 137 | * @param array $params Parameters array 138 | * @return array Results 139 | */ 140 | protected function run($endpoint, $params = array()){ 141 | if (!is_resource($this->conn)) { 142 | if (!$this->getConnection()) return $this->failure('Can not initialize connection'); 143 | } 144 | 145 | $request_url = $this->buildUri($endpoint); 146 | curl_setopt($this->conn, CURLOPT_URL, $request_url); // URL to post to 147 | curl_setopt($this->conn, CURLOPT_RETURNTRANSFER, 1 ); // return into a variable 148 | $headers = array('Content-type: application/json', 'Authorization: Bearer ' . $this->_accessToken); 149 | curl_setopt($this->conn, CURLOPT_HTTPHEADER, $headers ); // custom headers 150 | curl_setopt($this->conn, CURLOPT_HEADER, false ); // return into a variable 151 | curl_setopt($this->conn, CURLOPT_POST, true); // POST 152 | $postBody = (!empty($params))? json_encode($params) : "{}"; 153 | curl_setopt($this->conn, CURLOPT_POSTFIELDS, $postBody); 154 | curl_setopt_array($this->conn, $this->_connectionOptions); // (optional) additional options 155 | 156 | $result = curl_exec( $this->conn ); 157 | if ($result === false) return $this->failure('Curl Error: ' . curl_error($this->conn)); 158 | $responseCode = curl_getinfo($this->conn, CURLINFO_HTTP_CODE); 159 | if (!self::successfulHttpResponse($responseCode)){ 160 | return $this->failure('Error ['.$responseCode.']: ' . $result); 161 | } 162 | 163 | $this->closeConnection(); 164 | 165 | $parsedResult = json_decode($result,true); 166 | $jsonErr = json_last_error(); 167 | if ($parsedResult === null && $jsonErr !== JSON_ERROR_NONE) return $this->failure("Error [$jsonErr] parsing result JSON"); 168 | 169 | $status = $parsedResult['status']; 170 | if ($status != self::SM_STATUS_SUCCESS) return $this->failure("API Error: Status [$status:" . self::explainStatusCode($status) . ']. Message [' . $parsedResult["errmsg"] . ']'); 171 | else return $this->success($parsedResult["data"]); 172 | } 173 | 174 | 175 | 176 | /** 177 | * Return an error 178 | * @param string $msg Error message 179 | * @return array Result 180 | */ 181 | protected function failure($msg){ 182 | return array( 183 | 'success' => false, 184 | 'message' => $msg 185 | ); 186 | } 187 | 188 | /** 189 | * Return a success with data 190 | * @param string $data Payload 191 | * @return array Result 192 | */ 193 | protected function success($data){ 194 | return array( 195 | 'success' => true, 196 | 'data' => $data 197 | ); 198 | } 199 | 200 | 201 | /*************************** 202 | * SurveyMonkey API methods 203 | ***************************/ 204 | 205 | //survey methods 206 | 207 | /** 208 | * Retrieves a paged list of surveys in a user's account. 209 | * @see https://developer.surveymonkey.com/mashery/get_survey_list 210 | * @param array $params optional request array 211 | * @return array Result 212 | */ 213 | public function getSurveyList($params = array()){ 214 | return $this->run('surveys/get_survey_list', $params); 215 | } 216 | 217 | /** 218 | * Retrieve a given survey's metadata. 219 | * @see https://developer.surveymonkey.com/mashery/get_survey_details 220 | * @param string $surveyId Survey ID 221 | * @return array Results 222 | */ 223 | public function getSurveyDetails($surveyId){ 224 | $params = array('survey_id'=>$surveyId); 225 | return $this->run('surveys/get_survey_details', $params); 226 | } 227 | 228 | /** 229 | * Retrieves a paged list of collectors for a survey in a user's account. 230 | * @see https://developer.surveymonkey.com/mashery/get_collector_list 231 | * @param string $surveyId Survey ID 232 | * @param array $params optional request array 233 | * @return array Results 234 | */ 235 | public function getCollectorList($surveyId, $params = array()){ 236 | $params['survey_id'] = $surveyId; 237 | return $this->run('surveys/get_collector_list', $params); 238 | } 239 | 240 | /** 241 | * Retrieves a paged list of respondents for a given survey and optionally collector 242 | * @see https://developer.surveymonkey.com/mashery/get_respondent_list 243 | * @param string $surveyId Survey ID 244 | * @param array $params optional request array 245 | * @return array Results 246 | */ 247 | public function getRespondentList($surveyId, $params = array()){ 248 | $params['survey_id'] = $surveyId; 249 | return $this->run('surveys/get_respondent_list', $params); 250 | } 251 | 252 | /** 253 | * Takes a list of respondent ids and returns the responses that correlate to them. 254 | * @see https://developer.surveymonkey.com/mashery/get_responses 255 | * @param string $surveyId Survey ID 256 | * @param array $respondentIds Array of respondents IDs to retrieve 257 | * @param integer $chunkSize optional number of respondants to fetch in each chunk. We split it to multiple requests to conform with SurveyMonkey's API limits. If successful, the returned array is a joined array of all chunks. 258 | * @return array Results 259 | */ 260 | public function getResponses($surveyId, $respondentIds, $chunkSize = 100){ 261 | // Split requests to multiple chunks, if larger then $chunkSize 262 | if (count($respondentIds) > $chunkSize){ 263 | $data = array(); 264 | foreach (array_chunk($respondentIds, $chunkSize) as $r){ 265 | $result = $this->getResponses($surveyId, $r, $chunkSize); 266 | if (!$result["success"]) return $result; 267 | $data = array_merge($data, $result["data"]); 268 | } 269 | return $this->success($data); 270 | } 271 | 272 | $params = array( 273 | 'survey_id' => $surveyId, 274 | 'respondent_ids' => $respondentIds 275 | ); 276 | return $this->run('surveys/get_responses', $params); 277 | } 278 | 279 | /** 280 | * Returns how many respondents have started and/or completed the survey for the given collector 281 | * @see https://developer.surveymonkey.com/mashery/get_response_counts 282 | * @param string $collectorId Collector ID 283 | * @return array Results 284 | */ 285 | public function getResponseCounts($collectorId){ 286 | $params = array('collector_id' => $collectorId); 287 | return $this->run('surveys/get_response_counts', $params); 288 | } 289 | 290 | //user methods 291 | 292 | /** 293 | * Returns basic information about the logged-in user 294 | * @see https://developer.surveymonkey.com/mashery/get_user_details 295 | * @return array Results 296 | */ 297 | public function getUserDetails(){ 298 | return $this->run('user/get_user_details'); 299 | } 300 | 301 | //template methods 302 | 303 | /** 304 | * Retrieves a paged list of templates provided by survey monkey. 305 | * @see https://developer.surveymonkey.com/mashery/get_template_list 306 | * @param array $params optional request array 307 | * @return array Results 308 | */ 309 | public function getTemplateList($params = array()){ 310 | return $this->run('templates/get_template_list', $params); 311 | } 312 | 313 | //collector methods 314 | 315 | /** 316 | * Retrieves a paged list of templates provided by survey monkey. 317 | * @see https://developer.surveymonkey.com/mashery/create_collector 318 | * @param string $surveyId Survey ID 319 | * @param string $collectorName optional Collector Name - defaults to 'New Link' 320 | * @param string $collectorType required Collector Type - only 'weblink' currently supported 321 | * @param array $params optional request array 322 | * @return array Results 323 | */ 324 | public function createCollector($surveyId, $collectorName = null, $collectorType = 'weblink'){ 325 | $params = array( 326 | 'survey_id'=>$surveyId, 327 | 'collector'=>array( 328 | 'type'=>$collectorType, 329 | 'name'=>$collectorName 330 | ) 331 | ); 332 | return $this->run('collectors/create_collector', $params); 333 | } 334 | 335 | //batch methods 336 | 337 | /** 338 | * Create a survey, email collector and email message based on a template or existing survey. 339 | * @see https://developer.surveymonkey.com/mashery/create_flow 340 | * @param string $surveyTitle Survey Title 341 | * @param array $params optional request array 342 | * @return array Results 343 | */ 344 | public function createFlow($surveyTitle, $params = array()){ 345 | if (isset($params['survey'])){ 346 | $params['survey']['survey_title'] = $surveyTitle; 347 | } 348 | else{ 349 | $params['survey'] = array('survey_title'=>$surveyTitle); 350 | } 351 | return $this->run('batch/create_flow', $params); 352 | } 353 | 354 | /** 355 | * Create an email collector and email message attaching them to an existing survey. 356 | * @see https://developer.surveymonkey.com/mashery/send_flow 357 | * @param string $surveyId Survey ID 358 | * @param array $params optional request array 359 | * @return array Results 360 | */ 361 | public function sendFlow($surveyId, $params = array()){ 362 | $params['survey_id'] = $surveyId; 363 | return $this->run('batch/send_flow', $params); 364 | } 365 | } 366 | 367 | /** 368 | * A basic class for SurveyMonkey Exceptions. 369 | * @package default 370 | */ 371 | class SurveyMonkey_Exception extends Exception {} -------------------------------------------------------------------------------- /tests/all_methods.php: -------------------------------------------------------------------------------- 1 | 2, 22 | // 'page_size'=>1, 23 | // 'start_date'=>'2013-02-02 00:00:00', 24 | // 'end_date'=>'2013-04-12 22:43:01', 25 | // 'title'=>'My Survey', 26 | // 'recipient_email'=>'test@gmail.com', 27 | 'order_asc'=>false, 28 | 'fields'=>array('title','preview_url','date_created','date_modified','question_count') 29 | ); 30 | 31 | $list = $survey_monkey->getSurveyList($params); 32 | print_r($list); 33 | 34 | ////////////////////////////////////////////////////////// 35 | //GET SURVEY DETAILS 36 | ////////////////////////////////////////////////////////// 37 | $survey_id = 'SURVEYID'; 38 | $details = $survey_monkey->getSurveyDetails($survey_id); 39 | print_r($details); 40 | 41 | ////////////////////////////////////////////////////////// 42 | //GET COLLECTOR LIST 43 | ////////////////////////////////////////////////////////// 44 | $survey_id = 'SURVEYID'; 45 | $params = array( 46 | // 'page'=>2, 47 | 'page_size'=>10, 48 | // 'start_date'=>'2013-02-02 00:00:00', 49 | // 'end_date'=>'2013-04-12 22:43:01', 50 | // 'title'=>'My Survey', 51 | // 'recipient_email'=>'test@gmail.com', 52 | 'order_asc'=>false, 53 | 'fields'=>array('title','preview_url','date_created','date_modified','question_count') 54 | ); 55 | 56 | $list = $survey_monkey->getCollectorList($survey_id, $params); 57 | print_r($list); 58 | 59 | ////////////////////////////////////////////////////////// 60 | //GET RESPONDENT LIST 61 | ////////////////////////////////////////////////////////// 62 | $survey_id = 'SURVEYID'; 63 | $params = array( 64 | // 'collector_id'=>'COLLECTORID', 65 | // 'page'=>2, 66 | 'page_size'=>10, 67 | // 'start_date'=>'2013-02-02 00:00:00', 68 | // 'end_date'=>'2013-04-12 22:43:01', 69 | 'order_by'=>'date_start', 70 | // 'recipient_email'=>'test@gmail.com', 71 | 'order_asc'=>false, 72 | 'fields'=>array('title','preview_url','date_created','date_modified','question_count') 73 | ); 74 | 75 | $list = $survey_monkey->getRespondentList($survey_id, $params); 76 | print_r($list); 77 | 78 | ////////////////////////////////////////////////////////// 79 | //GET RESPONSES 80 | ////////////////////////////////////////////////////////// 81 | $survey_id = 'SURVEYID'; 82 | $respondent_ids = array('RID1', 'RID2'); 83 | 84 | $responses = $survey_monkey->getResponses($survey_id, $respondent_ids); 85 | print_r($responses); 86 | 87 | ////////////////////////////////////////////////////////// 88 | //GET RESPONSE COUNTS 89 | ////////////////////////////////////////////////////////// 90 | $collector_id = 'COLLECTORID'; 91 | $response_counts = $survey_monkey->getResponseCounts($collector_id); 92 | print_r($response_counts); 93 | 94 | ////////////////////////////////////////////////////////// 95 | //GET USER DETAILS 96 | ////////////////////////////////////////////////////////// 97 | $user_details = $survey_monkey->getUserDetails(); 98 | print_r($user_details); 99 | 100 | ////////////////////////////////////////////////////////// 101 | //GET TEMPLATE LIST 102 | ////////////////////////////////////////////////////////// 103 | $params = array( 104 | 'page'=>1, 105 | 'page_size'=>2, 106 | 'language_id'=>1, 107 | // 'category_id'=>'', 108 | 'show_only_available_to_current_user'=>true, 109 | 'fields'=>array('title','short_description','date_created','date_modified','question_count') 110 | ); 111 | 112 | $list = $survey_monkey->getTemplateList($params); 113 | print_r($list); 114 | 115 | ////////////////////////////////////////////////////////// 116 | //CREATE COLLECTOR 117 | ////////////////////////////////////////////////////////// 118 | $survey_id = 'SURVEYID'; 119 | $collector_name = 'Test Link 123'; 120 | $collector = $survey_monkey->createCollector($survey_id, $collector_name); 121 | print_r($collector); 122 | 123 | 124 | ////////////////////////////////////////////////////////// 125 | //CREATE FLOW 126 | ////////////////////////////////////////////////////////// 127 | $survey_id = 'SURVEYID'; 128 | $res = $survey_monkey->createFlow('Movie Survey', array( 129 | 'survey'=>array( 130 | 'from_survey_id'=>$survey_id, 131 | 'survey_title'=>'What movie would YOU like to watch?' 132 | ), 133 | 'collector'=>array( 134 | 'type'=>'email', 135 | 'send'=>true, 136 | 'name'=>'Test Email Collector', 137 | 'recipients'=>array( 138 | array( 139 | 'first_name'=>'John', 140 | 'last_name'=>'Smith', 141 | 'email'=>'tester@gmail.com' 142 | ), 143 | array( 144 | 'first_name'=>'Jane', 145 | 'last_name'=>'Smith', 146 | 'email'=>'tester2@gmail.com' 147 | ) 148 | ) 149 | ), 150 | 'email_message'=>array( 151 | 'reply_email'=>'me@gmail.com', 152 | 'subject'=>'Choose our next Movie!', 153 | 'body_text'=>"You can help decide our next movie:[SurveyLink] If you don't want to receive any more emails from us, click here: [RemoveLink]." 154 | ) 155 | )); 156 | print_R($res); 157 | 158 | 159 | ////////////////////////////////////////////////////////// 160 | //SEND FLOW 161 | ////////////////////////////////////////////////////////// 162 | $survey_id = 'SURVEYID'; 163 | $params = array( 164 | 'collector'=>array( 165 | 'type'=>'email', 166 | 'send'=>true, 167 | 'name'=>'Another Test Email Collector', 168 | 'recipients'=>array( 169 | array( 170 | 'first_name'=>'John', 171 | 'last_name'=>'Smith', 172 | 'email'=>'tester@gmail.com' 173 | ), 174 | array( 175 | 'first_name'=>'Jane', 176 | 'last_name'=>'Smith', 177 | 'email'=>'tester2@gmail.com' 178 | ) 179 | ), 180 | ), 181 | 'email_message'=>array( 182 | 'reply_email'=>'me@gmail.com', 183 | 'subject'=>'Choose our next Movie!', 184 | 'body_text'=>"You can help decide our next movie:[SurveyLink] If you don't want to receive any more emails from us, click here: [RemoveLink]." 185 | ) 186 | ); 187 | $res = $survey_monkey->sendFlow($survey_id, $params); 188 | 189 | print_r($res); 190 | 191 | 192 | 193 | 194 | ?> --------------------------------------------------------------------------------