Skip to content
Mateusz Drost edited this page Sep 1, 2015 · 4 revisions

Quickstart

Send an SMS

<?php

require_once 'smsapi/Autoload.php';

$client = new \SMSApi\Client('login');
$client->setPasswordHash( md5('super tajne haslo') );

$smsapi = new \SMSApi\Api\SmsFactory();
$smsapi->setClient($client);

try {

	$actionSend = $smsapi->actionSend();

	$actionSend->setTo('600xxxxxx');
	$actionSend->setText('Hello World!!');
	$actionSend->setSender('SMSAPI.pl');

	$response = $actionSend->execute();

	foreach( $response->getList() as $status ) {
		echo  $status->getNumber() . ' ' . $status->getPoints() . ' ' . $status->getStatus();
	}
}
catch( \SMSApi\Exception\SmsapiException $e ) {
	echo 'ERROR: ' . $e->getMessage();
}

Examples

Example Code

Clone this wiki locally