smsup / smsup-api-bundle

用于通过smsup.es API发送短信的Symfony2包

安装次数: 1,996

依赖者: 0

建议者: 0

安全性: 0

星标: 2

关注者: 2

分支: 0

公开问题: 0

类型:symfony-bundle

v1.0.1 2016-09-30 16:47 UTC

This package is not auto-updated.

Last update: 2024-09-14 18:20:21 UTC


README

Latest Stable Version SensioLabsInsight

用于通过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);

查看更多使用数据