smsup / smsup-api-bundle
用于通过smsup.es API发送短信的Symfony2包
v1.0.1
2016-09-30 16:47 UTC
Requires
- php: >=5.3.2
- smsup/smsuplib: ~2.0
This package is not auto-updated.
Last update: 2024-09-14 18:20:21 UTC
README
用于通过smsup.es API发送短信的Symfony2包
安装
使用composer进行安装
composer require smsup/smsup-api-bundle
添加到AppKernel.php
new smsup\SmsupapiBundle\SmsupapiBundle(),
在config.yml中添加必要的参数
smsupapi: api_id: ID_USUARIO_API api_secret: CLAVE_SECRETA_API
使用
发送新的短信
$sender = $this->get('smsup.smsupapi.sender'); $sms = $sender->getNewSms() ->setTexto('Texto del sms') ->setNumeros(['000000000']); $resul = $sender->enviarSms($sms); if($resul->getHttpcode()===200){ $idenvio = $resul->getResult()[0]['id']; }
删除短信发送
$sender = $this->get('smsup.smsupapi.sender'); $sender->eliminarSms($idsms);
获取短信状态
$sender = $this->get('smsup.smsupapi.sender'); $sender->estadoSms($idsms);
获取账户中可用的余额
$sender = $this->get('smsup.smsupapi.sender'); $sender->creditosDisponibles();
获取先前请求的结果
$sender = $this->get('smsup.smsupapi.sender'); $sender->resultadoPeticion($referencia);