Clickatell API SMS intergration PHP
5022
$$
- Posted:
- Proposals: 1
- Remote
- #30391
- Archived
Description
Experience Level: Intermediate
Currently have an existing API setup with another provider. I require a freelancer to take the following code and insert it in to the existing system as well as ensure that it works.
<?
$user = \"xxxxxxxx\";
$password = \"xxxxxx\";
$api_id = \"xxxxxxxx\";
$baseurl =\"http://api.clickatell.com\";
$text = urlencode(\"This is an example message\");
$to = \"0123456789\";
// auth call
$url = \"$baseurl/http/auth?user=$user&password=$password&api_id=$api_id\";
// do auth call
$ret = file($url);
// split our response. return string is on first line of the data returned
$sess = split(\":\",$ret[0]);
if ($sess[0] == \"OK\") {
$sess_id = trim($sess[1]); // remove any whitespace
$url = \"$baseurl/http/sendmsg?session_id=$sess_id&to=$to&text=$text\";
// do sendmsg call
$ret = file($url);
$send = split(\":\",$ret[0]);
if ($send[0] == \"ID\")
echo \"success
message ID: \". $send[1];
else
echo \"send message failed\";
} else {
echo \"Authentication failure: \". $ret[0];
exit();
}
?>
<?
$user = \"xxxxxxxx\";
$password = \"xxxxxx\";
$api_id = \"xxxxxxxx\";
$baseurl =\"http://api.clickatell.com\";
$text = urlencode(\"This is an example message\");
$to = \"0123456789\";
// auth call
$url = \"$baseurl/http/auth?user=$user&password=$password&api_id=$api_id\";
// do auth call
$ret = file($url);
// split our response. return string is on first line of the data returned
$sess = split(\":\",$ret[0]);
if ($sess[0] == \"OK\") {
$sess_id = trim($sess[1]); // remove any whitespace
$url = \"$baseurl/http/sendmsg?session_id=$sess_id&to=$to&text=$text\";
// do sendmsg call
$ret = file($url);
$send = split(\":\",$ret[0]);
if ($send[0] == \"ID\")
echo \"success
message ID: \". $send[1];
else
echo \"send message failed\";
} else {
echo \"Authentication failure: \". $ret[0];
exit();
}
?>
Get S.
0% (0)Projects Completed
1
Freelancers worked with
1
Projects awarded
100%
Last project
20 Jul 2010
United Kingdom
New Proposal
Login to your account and send a proposal now to get this project.
Log inClarification Board Ask a Question
-
There are no clarification messages.
We collect cookies to enable the proper functioning and security of our website, and to enhance your experience. By clicking on 'Accept All Cookies', you consent to the use of these cookies. You can change your 'Cookies Settings' at any time. For more information, please read ourCookie Policy
Cookie Settings
Accept All Cookies