This command can be used to create a shortened URL using our built in Short URL Creator.
https://api.textlocal.in/create_shorturl/
<?php
// Account details
$apiKey = urlencode('Your apiKey');
// URL Information
$url = "https://api.textlocal.in";
// Prepare data for POST request
$data = array('apikey' => $apiKey, 'url' => $url);
// Send the POST request with cURL
$ch = curl_init('https://api.textlocal.in/create_shorturl/');
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');
// URL Information
$url = "https://api.textlocal.in";
// Prepare data for POST request
$data = 'apikey=' . $apiKey . '&url=' . $url;
// Send the GET request with cURL
$ch = curl_init('https://api.textlocal.in/create_shorturl/?' . $data);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
$response = curl_exec($ch);
curl_close($ch);
// Process your response here
echo $response;
?>Sorry, we do not have an example for Class in the language you have chosen.
| url | Use this field to specify the URL you want the shortened URL to redirect to. |
|---|---|
| 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. |
{
"shorturl":"https://tx.gl/r/1r0S",
"status":"success"
}<response>
<shorturl>https://tx.gl/r/1r0S</shorturl>
<status>success</status>
</response>| Error Codes | |
| 185 | No URL Specified |
|---|---|
| 186 | Invalid URL Specified |