1. 程式人生 > >Ruby調取短信驗證碼

Ruby調取短信驗證碼

Ruby 短信驗證碼 創藍253 調用接口

【創藍253雲通訊平臺---短信驗證碼接口demo】
# 該代碼僅供學習和研究接口使用,只是提供了一個參考

require ‘typhoeus‘

# 發送短信接口URL,如無必要,該參數可不用修改
api_send_url="http://222.73.117.156/msg/HttpBatchSendSM"
# 創藍帳號,替換成您自己的帳號
account="xxxxxx"
# 創藍密碼,替換成您自己的密碼
pswd="xxxxxx"

body={account:account,pswd:pswd,mobile:"13800138000",msg:"您好,您的驗證碼是1234",needstatus:"true"}

resp=Typhoeus::Request.post(api_send_url,body:body)
puts resp.body

Ruby調取短信驗證碼