How to create Automated Phone Survey Easily.

Examinare Phone surveys can be used together with your favorite phone system. As long as the system that you use PBX (or whatever you use) can give you the call list to send phone surveys to then you can schedule automatic phone surveys easily with Examinare Phone Surveys API.

 

Step 1: Apply for the Phone Survey extension to be activated.

When applying to get your Phone Survey functionality activated we also need to activate your Caller ID. This is done easily by contacting the Examinare Support.

 

Step 2: Create your Phone Survey questions.

Before sound files can be uploaded you need to create the text version of the Survey. Use the “Multiple choice question” question type to make the options 1 to 10. This way the Survey Tool can analyze the results easily.

phone-surveys-question-example

 

Step 3: Upload sound files or record it on every question in the survey.

phone-survey-record-option

You can upload your own sound files on every question by clicking on the “Include file” and click on “Phone Surveys”. If you do not have any recorded files then you can record it live with the microphone inside the Survey Tool.

 

Step 4: Create a test user for checking the survey.

Create a recipient in your Examinare account that includes a phone number on the Phone number field. Make sure that the number is in International format.

phone-survey-create-recipient

 

Step 5: Publish your Survey as a private survey.

Publish the survey as Private web survey and test it on the “Phone Survey” option with your own test user. Your phone will ring within 2 minutes from you have sent the phone survey.

 

Step 6: Activate Examinare API.

Navigate to Settings -> Advanced settings and activate the Examinare API. Note down the details and continue to next step.

 

Step 7: Use PHP for the sample script to activate the phone survey calls.

Please note: Almost all phone systems have their own routines to get the call logs. We cannot cover all in this tutorial but if you contact the support team at support@examinare.com they can help you find the correct way of getting the call-log in real time.

The following code will help you to get the survey call sent.


PHP Example

<?php 

	include_once("lib/examinare-api.php");
	
	$key["apicompany"]="XXXX";// Change this to your API company						
	$key["apikey"]="YYYYYY"; // Change this to your API token	
	$key["phonesurveyid"]="ZZZZZZ"; // Change this to Phone Survey ID	
	$key["callerid"]="+17000000"; // Change this to Caller ID (Must be authenticated) and in International Format.			
	/* Change the top information 	according to your account details. */
						
	$phonenumber="+460000000"; // Use this parameter for the phone number.					
						
						
	$api = new ExaminareAPIConnector($key["apicompany"],$key["apikey"],"");
	$api->setCommand("addRecipient");
	$recipient_r = Array();
                        
	$recipient_r["name"]="User at ".$phonenumber;
	$recipient_r["email"]="myname@mydomain.com";
	$recipient_r["group"]="Phone Survey Group";
    $recipient_r["phonenumber"]=$phonenumber;
	                    
	$api->Data($recipient_r);
						
	$person=$api->Execute();
	
	if($person["contacts"]["contact"]["contactID"]!=""){
		$sendcontactid = $person["contacts"]["contact"]["contactID"];
		
		$callapi = new ExaminareAPIConnector($key["apicompany"],$key["apikey"],"");
		$callapi->setCommand("sendPhoneSurvey");
		$callapi->Data(array('surveyID' => $key["phonesurveyid"], 'user_1' => $sendcontactid, 'callerID'=>$key["callerid"]));
		$done=$callapi->Execute();
		if(is_array($done["status"])){
			echo "SUCCESS";
			
			
		}else{
			echo "Here is an error. Sent the following: ";	
			print_r(array('Phone number' => $phonenumber));
			echo "Got the following error data".print_r($done);
		}
	}
	
?>

 

Step 8: Optionally setup as a cronjob

There a many ways of sending the phone survey requests. If you do not want to use it manually inside other PHP code then you can setup the job as a crontab schedualed task like this to be run every minute.

* * * * * wget -O /dev/null -q http://urltoyourphpfile/cron.php