語音驗(yàn)證碼接口文檔 點(diǎn)擊下載
語音驗(yàn)證碼接口接入指南 點(diǎn)擊訪問
#接口類型:互億無線語音驗(yàn)證碼接口。
#賬戶注冊:請通過該地址開通賬戶https://user.ihuyi.com/new/register.html
#注意事項(xiàng):
#(1)調(diào)試期間,請仔細(xì)閱讀接口文檔;
#(2)請使用 APIID 及 APIKEY來調(diào)用接口,可在會(huì)員中心獲??;
#(3)該代碼僅供接入互億無線短信接口參考使用,客戶可根據(jù)實(shí)際需要自行編寫;
#!/usr/local/bin/python
#-*- coding:utf-8 -*-
import httplib
import urllib
host = "api.voice.ihuyi.com"
sms_send_uri = "/webservice/voice.php?method=Submit"
#查看用戶名 登錄用戶中心->語音驗(yàn)證碼>產(chǎn)品總覽->API接口信息->APIID
account = "用戶名"
#查看密碼 登錄用戶中心->語音驗(yàn)證碼>產(chǎn)品總覽->API接口信息->APIKEY
password = "密碼"
def send_sms(text, mobile):
params = urllib.urlencode({'account': account, 'password' : password, 'content': text, 'mobile':mobile,'format':'json' })
headers = {"Content-type": "application/x-www-form-urlencoded", "Accept": "text/plain"}
conn = httplib.HTTPConnection(host, port=80, timeout=30)
conn.request("POST", sms_send_uri, params, headers)
response = conn.getresponse()
response_str = response.read()
conn.close()
return response_str
if __name__ == '__main__':
mobile = "138xxxxxxxx"
text = "1125"
print(send_sms(text, mobile))
驗(yàn)證碼已發(fā)送到您的手機(jī),請查收!
輸入驗(yàn)證碼后,點(diǎn)擊“開通體驗(yàn)賬戶”按鈕可立即開通體驗(yàn)賬戶。