我尝试在我的应用程序中实现twilio短信验证。我按照this指南实现了短信验证。现在我收到短信成功了,但是twilio API不能识别它。我是否需要使用REST或手动在应用程序中添加用户才能通过twilio api进行验证?
我尝试按照this指南添加用户,如下所示来获取我的authy_id
{
"api_key":"OaQi0sSxw9UVbJr234vGj0MOgdfZFkn5",
"email":"jxyz198@gmail.com",
"cellphone":"7989661708",
"country_code":"91"
}但它要求将authy id作为此响应的参数。
{
"error_code": "60004",
"message": "Invalid parameter: authy_id - Parameter is required",
"errors": {
"message": "Invalid parameter: authy_id - Parameter is required"
},
"success": false
}当我在生成authy_id时,我如何提供它?
发布于 2018-11-23 01:19:03
创建用户的正确url为:https://api.authy.com/protected/json/users/new
工作示例:
curl -X POST --data "api_key=YOUR_API_KEY&\
user[email]=new_user@email.com&\
user[cellphone]=405-342-5699&\
user[country_code]=1" \
https://api.authy.com/protected/json/users/new响应:
{"message":"User created successfully.","user":{"id":48952},"success":true}也是
curl -X POST --data "api_key=YOUR_API_KEY&authy_id=48952"\
https://api.authy.com/protected/json/sdk/registrations返回响应:
{"registration_token":"3D98vsvh4GcaZM4EVXt4RLQXvszM8NNo1lqftYv8czk","success":true}您可以将此内标识用于SDK
https://stackoverflow.com/questions/49550603
复制相似问题