Python 阿里大于发送手机验证码

时间:2023-02-05 14:15:28

1.安装阿里大于的包

pip install top

2.事例脚本

# -*- coding: utf-8 -*-
import top.api appkey = '2353xxxx'
secret = 'e25296e930689453b6f577e5xxxxxxxx'
req = top.api.AlibabaAliqinFcSmsNumSendRequest()
req.set_app_info(top.appinfo(appkey, secret)) req.extend = ""
req.sms_type = "normal"
req.sms_free_sign_name = "繁华网络"
req.sms_param = "{code:'1234'}"
req.rec_num = "1814439xxxx"
req.sms_template_code = "SMS_2629xxxx"
try :
resp = req.getResponse()
print (resp)
except Exception,e:
print (e)

3.成功返回事例

{u'alibaba_aliqin_fc_sms_num_send_response': {u'result': {u'msg': u'OK', u'model': u'969322615209028960^0', u'success': True, u'err_code': u'0'}, u'request_id': u'2ewzkt9g9c2a'}}