textlocal.com发送短信的问题

发布于 2025-02-05 06:39:20 字数 834 浏览 2 评论 0原文

I try to use the below example of sending sms by Textlocal.com:

$apiKey = urlencode('Your apiKey');

$numbers = array('123456789');
$sender = urlencode('TXTLCL');
$message = rawurlencode('This is your message');

$numbers = implode(',', $numbers);

$data = array('apikey' => $apiKey, 'numbers' => $numbers, "sender" => $sender, "message" => $message);

$ch = curl_init('https://api.textlocal.in/send/');
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);

echo $response;

I always receive the error:

{"errors":[{"code":3,"message":"Invalid login details"}],"status":"failure"}

Link to the documentation:

有人可以解决这个问题吗?

I try to use the below example of sending sms by Textlocal.com:

$apiKey = urlencode('Your apiKey');

$numbers = array('123456789');
$sender = urlencode('TXTLCL');
$message = rawurlencode('This is your message');

$numbers = implode(',', $numbers);

$data = array('apikey' => $apiKey, 'numbers' => $numbers, "sender" => $sender, "message" => $message);

$ch = curl_init('https://api.textlocal.in/send/');
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);

echo $response;

I always receive the error:

{"errors":[{"code":3,"message":"Invalid login details"}],"status":"failure"}

Link to the documentation: https://api.textlocal.in/docs/sendsms

Does anyone have a solution to the problem ?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。
列表为空,暂无数据
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文