最近免费中文字幕中文高清,亚洲欧美综合一区二区三区,在线av观看,最近高清中文字幕免费mv,中文字幕人妻在线中字

秒賽科技 · 技術支持

短信接口示例

這篇文章主要為大家分享Python短信接口代碼,Python短信發(fā)送、Python批量發(fā)送、Python短信驗證碼發(fā)送,感興趣的小伙伴們可以參考一下。


#!/usr/bin/env python
# -*- coding: utf-8 -*-

import requests
import json
import hashlib
import time

class SendCode:

    def send(self,account,pswd,mobile,msg,ts,state):
        url = 'http://139.196.108.241:8080'+{
            1:'/Api/HttpSendSMYzm.ashx',
            2:'/Api/HttpSendSMYx.ashx',
            3:'/Api/HttpSendSMVoice.ashx'
        }[state];
        if ts!="" :
            m = hashlib.md5()
            strs = account+pswd+str(ts)
            m.update(strs.encode("utf8"))
            pswd = m.hexdigest()
        body = {"account": account, "pswd": pswd, "mobile": mobile,"msg":msg,"ts":str(ts)}

        header_dict = {'User-Agent': 'Mozilla/5.0 (Windows NT 6.1; Trident/7.0; rv:11.0) like Gecko',
                       "Content-Type": "application/x-www-form-urlencoded"}

        response = requests.post(url, data=body,headers = header_dict)

        return  json.loads( response.text)


# account 用戶賬號
# pswd 必填參數。用戶密碼
# mobile 必填參數。合法的手機號碼
# msg  必填參數。短信內容
# ts  可選參數,時間戳,格式y(tǒng)yyyMMddHHmmss
# state 必填參數   狀態(tài)  1:驗證碼短信  2:營銷短信  3:語音驗證碼


send = SendCode()
res = send.send('您的賬號','您的密碼','手機號','短信內容',  (int(time.time())),1)
# print(res['result'])


現在注冊,送100+體驗短信!

立即免費注冊

正規(guī)資質

工信部核準SP資質,移動、電信、聯通金牌合作伙伴

價格透明

短信套餐明碼實價,提供每一條短信消費明細記錄

信息保密

所有客戶信息嚴格保密,保護客戶信息免遭外泄

售后無憂

專業(yè)團隊提供免費技術支持,7X24小時售后服務

掃一掃

掃碼關注 · 認證、審核結果通知 · 短信發(fā)送結果通知 · 活動及最新平臺信息

返回頂部