Answer the question
In order to leave comments, you need to log in
Does anyone work with SMSsync?
Hello!
I installed the application on smart smssync.ushahidi.com I uploaded the
sms.php file to the hosting, I drove the example code smssync.ushahidi.com/developers into it I
created a text.txt file with rights 777 in the root (for the duration of the test)
I set up the application , the secret key as in example 123456
I address like this:
http://сайт.ру/sms.php?from=номер отправителя&message=test&secret=123456&sent_to=номер получателя
From: номер отправителя
Message: test
Sent to: номер получателя
{"payload":{"success":true,"task":"send","secret":"123456","messages":[{"to":"номер получателя","message":"Your message has been received","uuid":"1ba368bd-c467-4374-bf28"}]}}{"payload":{"success":true,"error":null}}
Answer the question
In order to leave comments, you need to log in
I figured it out praying
, firstly, you need to enable auto-synchronization in the settings, check tasks, and if you need the result of sending the result API,
after that a message from the template will be sent to the number +0000000000 with each check of tasks.
in the send_task function, the message itself is formed,
and the get_sent_message_uuids function directly sends
it to fetch messages from mysql (example)
function send_task()
{
/**
* Comment the code below out if you want to send an instant
* reply as SMS to the user.
*
* This feature requires the "Get reply from server" checked on SMSsync.
*/
if (isset($_GET['task']) AND $_GET['task'] === 'send')
{
$q = mysql_query ('SELECT * FROM test WHERE status=0') or die (mysql_error());
if (mysql_num_rows($q)>0){
while($get = mysql_fetch_assoc($q)) {
$message = $get['msg'];
//$f = "+000-000-0000";
$to = $get['phone'];
$seccess = "true";
$uuid = $get['msg_id'];
$reply[] = [
"to" => $to,
"message" => $message,
"uuid" => $uuid
];
mysql_query('UPDATE test SET status=1 WHERE msg_id="'.$uuid.'"');
// Send JSON response back to SMSsync
}
$response = json_encode(
["payload"=>[
"success"=>$seccess,
"task"=>"send",
"secret" => "123456",
"messages"=>array_values($reply)]
]);
send_response($response);
}
}
}
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question