Create, update and delete Short URL’s from your account.
http:// or https://
www.voodooSMS.com/vapi/server/short_url
Request
<?php
switch($_SERVER["REQUEST_METHOD"]) {
case "GET":
$uid = htmlspecialchars($_GET["uid"]);
$pass = htmlspecialchars($_GET["pass"]);
$file = htmlspecialchars($_GET["file"]);
$expiry = htmlspecialchars($_GET["expiry"]);
$method = htmlspecialchars($_GET["method"]);
$suid = htmlspecialchars($_GET["suid"]);
break;
case "POST":
$uid = htmlspecialchars($_POST["uid"]);
$pass = htmlspecialchars($_POST["pass"]);
$file = htmlspecialchars($_POST["file"]);
$expiry = htmlspecialchars($_POST["expiry"]);
$method= htmlspecialchars($_POST["method"]);
$suid = htmlspecialchars($_POST["suid"]);
break;
}
$url = 'https://www.voodoosms.com/vapi/server/shortURL?uid='.$uid.'&pass='.$pass.
'&file='.$file.'&expiry='.$expiry."&method=".$method."&suid=".$suid;
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 2);
// Download the given URL, and return output
$output = curl_exec($ch);
echo $output . " " . curl_error($ch);
// Close the cURL resource, and free system resources
curl_close($ch);
?>
Response
<xml>
<result>200</result>
<resultText>Short URL generated Successfully</resultText>
<name />
<shortUrlid>413</shortUrlid>
<shortUrl>vsms.co/54b</shortUrl>
<expires>5m</expires>
</xml>
On success, the response header HTTP status code will be 200 OK
confirming that the message is sent. If you try to send message without authorisation you an error code of 401 Unauthorized
will be received.
Response Code
Code | Type | Response |
---|---|---|
200 | int | OK |
400 | int | Required parameters are missing |
400 | int | Invalid file. You have given an invalid file extension. See documentation for valid extensions. |
400 | int | Invalid expiry format. See documentation for valid formats. |
400 | int | Expiry date cannot exceed 31 days. |
400 | int | Invalid file. File cannot be validated, it may not be available. |
400 | int | Invalid file. File size is greater than 10MB |
400 | int | Short URL could not be updated. Please try again, or contact support@voodoosms.com |
400 | int | There was a problem processing your link. Please try again, or contact support@voodoosms.com |
400 | int | Short URL could not be deleted. Please try again, or contact support@voodoosms.com |
400 | int | Invalid method. Use ‘add, update or delete’ |
401 | int | Your API credentials are invalid |