阿⾥云短信接⼝python版本# -*- coding: utf-8 -*-
#!/usr/bin/python
#encoding=utf-8
import sys
quest.v20170525 import SendSmsRequest
quest.v20170525 import QuerySendDetailsRequest
from aliyunsdkcore.client import AcsClient
import uuid
from aliyunsdkcore.profile import region_provider
from aliyunsdkcore.http import method_type as MT
from aliyunsdkcore.http import format_type as FT
import const
nowTime='\"2018-04-2\"'
addr='\"长沙\"'
T="\"后天4-4\""
W="\"晴转多云\""
H="\"25\""
L="\"19\""
FX="\"3级\""
print FX
print T
#print ${FX}
"""
短信业务调⽤接⼝⽰例,版本号:v20170525
Created on 2017-06-12
"""
try:
reload(sys)
sys.setdefaultencoding('utf8')
except NameError:
pass
except Exception as err:
raise err
# 注意:不要更改
REGION = "cn-hangzhou"
PRODUCT_NAME = "Dysmsapi"
字符串长度怎么数python
DOMAIN = "dysmsapi.aliyuncs"
acs_client = AcsClient(const.ACCESS_KEY_ID, const.ACCESS_KEY_SECRET, REGION)
region_provider.add_endpoint(PRODUCT_NAME, REGION, DOMAIN)
def send_sms(business_id, phone_numbers, sign_name, template_code, template_param=None):
smsRequest = SendSmsRequest.SendSmsRequest()
# 申请的短信模板编码,必填
smsRequest.set_TemplateCode(template_code)
# 短信模板变量参数
if template_param is not None:
smsRequest.set_TemplateParam(template_param)
# 设置业务请求流⽔号,必填。
smsRequest.set_OutId(business_id)
# 短信签名
smsRequest.set_SignName(sign_name)
# -*- coding: utf-8 -*-
# ACCESS_KEY_ID/ACCESS_KEY_SECRET 根据实际申请的账号信息进⾏替换
ACCESS_KEY_ID = "LTAI"
ACCESS_KEY_SECRET = "WTAQ3ThEwcOsQ0o"

版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系QQ:729038198,我们将在24小时内删除。