如何发送短信到美国号码Nexmo [英] how to send text to US numbers in Nexmo
问题描述
发送消息到菲律宾是简单的馅饼。
Sending message to Philippines is simple as pie.
但在美国的电话号码,我就必须要经过验证,我不知道怎么办。
But in US numbers, I'll have to go through verification that I do not know how.
我开始2F验证,但似乎我不知道接下来该怎么办。
I started 2F Authentication but seems that I dont know how to do next.
我的问题:
如何增加在Nexmo文本发送到美国的数字?
推荐答案
您可以使用Nexmo的短信API,它可以让你在200多个国家发送文字用一个简单的HTTP调用。
You can use Nexmo's SMS API which allows you to send a text in over 200 countries with a simple HTTP call.
您可以注册一个虚拟号码,让您发送短信和放大器;接收传入的消息也是如此。
You can sign up for a virtual number which allows you to send SMS messages & receive incoming message as well.
有关2FA,您可以使用API验证验证用户到特定的设备。
For 2FA, you can use the Verify API to authenticate users to a specific device.
这方法比自己使用短信API和随机产生的数字更安全。然后,引脚将由终端用户放大器输入;通过验证API检查。
This method is more secure than using an SMS API and randomly generating numbers yourself. The pin will then entered by the end user & checked by the Verify API.
这需要code几行,以使用这些API。下面是code在PHP中的模块,它可以让你使用SMS API来发送文本。
It takes a few lines of code to use either of these APIs. Below is a block of code in PHP which allows you to send a text using the SMS API.
<?php
$url = 'https://rest.nexmo.com/sms/json?' . http_build_query([
'api_key' => API_KEY,
'api_secret' => API_SECRET,
'to' => YOUR_NUMBER,
'from' => NEXMO_NUMBER,
'text' => 'Hello from Nexmo'
]);
$ch = curl_init($url);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
$response = curl_exec($ch);
下面是Nexmo的文档参考短信API 。
Here is the documentation for Nexmo's SMS API for reference.
下面是Nexmo的确认API 的,如果你正在寻找一个简单的2FA的文档解决方案。
Here is the documentation for Nexmo's Verify API if you were looking for a simple 2FA solution.
这篇关于如何发送短信到美国号码Nexmo的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!