A PHP wrapper for SabaNovin's REST API

v1.0.3 2020-11-20 08:52 UTC

This package is not auto-updated.

Last update: 2025-05-05 10:11:27 UTC


README

Installation

Use in these ways :

composer require sabanovin/php

Usage

Send Simple SMS by SabaNovin API:

require __DIR__ . '/vendor/autoload.php';

try{
	$api = new \SabaNovin\SabaNovinApi( "API-Key" );
	$gateway = "100020500";
	$text = "متن تست";
	$to = array("09370000000", "09120000000");
	$result = $api->Send($gateway, $to, $text);
	if($result->entries){
		foreach($result->entries as $entry) {
			echo "reference_id = $entry->reference_id";
			echo "status   = $entry->status";
			echo "mobile   = $entry->mobile";
			echo "datetime = $entry->datetime";
		}		
	}
}
catch(\SabaNovin\Exceptions\ApiException $e){
	echo $e->errorMessage();
}