PHP Class REST, phpsms

Show file Open project: toplan/phpsms Class Usage Examples

Public Methods

Method Description
__construct ( $ServerIP, $ServerPort, $SoftVersion, $BodyType = 'xml' ) 包体格式,可填值:json 、xml
accAuth ( ) : mixed 主帐号鉴权
curl_post ( string $url, mixed $data, mixed $header, mixed $post = 1 ) : mixed 发起HTTPS请求
sendTemplateSMS ( string $to, array $datas, mixed $tempId ) : mixed 发送模板短信
setAccount ( string $AccountSid, string $AccountToken ) 设置主帐号
setAppId ( string $AppId ) 设置应用ID
voiceVerify ( mixed $verifyCode, mixed $playTimes, mixed $to, mixed $displayNum = null, mixed $respUrl = null, mixed $lang = 'zh', mixed $userData = null, mixed $welcomePrompt = null, mixed $playVerifyCode = null ) : mixed 语音验证码

Method Details

__construct() public method

包体格式,可填值:json 、xml
public __construct ( $ServerIP, $ServerPort, $SoftVersion, $BodyType = 'xml' )

accAuth() public method

主帐号鉴权
public accAuth ( ) : mixed
return mixed

curl_post() public method

发起HTTPS请求
public curl_post ( string $url, mixed $data, mixed $header, mixed $post = 1 ) : mixed
$url string
$data mixed
$header mixed
$post mixed
return mixed

sendTemplateSMS() public method

发送模板短信
public sendTemplateSMS ( string $to, array $datas, mixed $tempId ) : mixed
$to string 短信接收彿手机号码集合,用英文逗号分开
$datas array 内容数据
$tempId mixed 模板Id
return mixed

setAccount() public method

设置主帐号
public setAccount ( string $AccountSid, string $AccountToken )
$AccountSid string 主帐号
$AccountToken string 主帐号Token

setAppId() public method

设置应用ID
public setAppId ( string $AppId )
$AppId string 应用ID

voiceVerify() public method

语音验证码
public voiceVerify ( mixed $verifyCode, mixed $playTimes, mixed $to, mixed $displayNum = null, mixed $respUrl = null, mixed $lang = 'zh', mixed $userData = null, mixed $welcomePrompt = null, mixed $playVerifyCode = null ) : mixed
$verifyCode mixed 验证码内容,为数字和英文字母,不区分大小写,长度4-8位
$playTimes mixed 播放次数,1-3次
$to mixed 接收号码
$displayNum mixed 显示的主叫号码
$respUrl mixed 语音验证码状态通知回调地址,云通讯平台将向该Url地址发送呼叫结果通知
$lang mixed 语言类型
$userData mixed 第三方私有数据
$welcomePrompt mixed 欢迎提示音,在播放验证码语音前播放此内容(语音文件格式为wav)
$playVerifyCode mixed 语音验证码的内容全部播放此节点下的全部语音文件
return mixed