enexmo ENexmo Library to use the Restful API offered by Mobile Messaging provider Nexmo.

  1. Introduction
  2. Requirements
  3. Usage
  4. Yes, is on Github
  5. Changelog
  6. Resources

Introduction

ENexmo Library allows Yii programmers to use the Restful API offered by Mobile Messaging provider Nexmo.

Nexmo is a cloud-based SMS API that lets you send and receive high volume of messages at wholesale rates.

Requirements

Usage

Once you have created your Nexmo account and include ENexmo library and EHttpClient on the extension folder is as easy as this::

/* import extensions before any call */
Yii::import('ext.httpclient.*');
Yii::import('ext.nexmo.*');

/* to send a message */
$nexmo_sms = new ENexmoSms('YOURAPIKEY','YOURAPISECRET');
		
$response = $nexmo_sms->sendTextMessage('RECIPIENTSNUMBER','SENDERID','Howdy testing! Please, search on http://www.google.com.');

/* responses are on JSON or XML. Defaults to JSON, but you can change that */
/* we use CHtml::encode for demo purposes only, to check for responses */
echo CHtml::encode($response);

/* to make requests for account */
$nexmo_account = new ENexmoAccount('key','secret');
$nexmo_account->format = ENexmoBase::FORMAT_JSON;

/* to search for a message */
echo CHtml::encode($nexmo_account->searchMessage('09AFDA98'));
//echo CHtml::encode($nexmo_account->searchMessagesByIds(array('09AFCC5B','09AFDA98')));
//echo CHtml::encode($nexmo_account->searchMessagesByDateAndRecipient('2012-03-20','34607040932'));
//echo CHtml::encode($nexmo_account->balance);
//echo CHtml::encode($nexmo_account->ownNumbers);
//echo CHtml::encode($nexmo_account->getSmsPricing('ES'));

Yes, is on Github

Anybody willing to help improving E1i8n is highly welcome. Check the github repository on the resources section.

Changelog

  • version 1.0.0 Initial version release

Resources

2 0
4 followers
0 downloads
Yii Version: 1.1
License: BSD-2-Clause
Category: Others
Tags: api, nexmo
Developed by: Antonio Ramirez
Created on: Mar 21, 2012
Last updated: 12 years ago

Related Extensions