Textlocal Logo

API Documentation

Get Surveys

This command will get a list of surveys ID's from your Textlocal account.

Resource URL

https://api.txtlocal.com/get_surveys/

Sample Request

<?php
	// Account details
	$apiKey = urlencode('Your apiKey');

	// Prepare data for POST request
	$data = array('apikey' => $apiKey);
 
	// Send the POST request with cURL
	$ch = curl_init('https://api.txtlocal.com/get_surveys/');
	curl_setopt($ch, CURLOPT_POST, true);
	curl_setopt($ch, CURLOPT_POSTFIELDS, $data);
	curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
	$response = curl_exec($ch);
	curl_close($ch);
	
	// Process your response here
	echo $response;
?>
<?php
	// Account details
	$apiKey = urlencode('Your apiKey');

	// Prepare data for POST request
	$data = $apiKey;
 
	// Send the GET request with cURL
	$ch = curl_init('https://api.txtlocal.com/get_surveys/?' . $data);
	curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
	$response = curl_exec($ch);
	curl_close($ch);
	
	// Process your response here
	echo $response;
?>
<?php
	require('Textlocal.class.php');
	
	$Textlocal = new Textlocal(false, false, 'your apiKey');
	
	$response = $Textlocal->getSurveys();
	print_r($response);
?>

Parameters

There are no additional parameters for this command
Login Parameters (Additional Information)
apiKey You can create these in your Messenger Control Panel (click here) for each application, and limit the usage of them by host IP Address.

Sample Response

{
	"survey_ids":[{
		"id":"1234"
	},
	{
		"id":"4321"
	}
	"status":"success"
}
<?xml version="1.0" encoding="UTF-8" ?>
<response>
	<survey_ids>
		<survey_id>
			<id>1234</id>
		</survey_id>
		<survey_id>
			<id>4321</id>
		</survey_id>
	</survey_ids>
	<status>success</status>
</response>

Errors

Error Codes
50 No surveys found on account.