Skip to content

Latest commit

History

29 Commits

Folders and files

NameName
Last commit message
Last commit date

Repository files navigation

epost-php

PHP client library for the e-post SMS API.

Requirements

  • PHP >= 7.0
  • cURL extension

Installation

composer require hostlink/epost-php

Usage

Initialise

require'vendor/autoload.php';
$key = 'your_jwt_token'; // Bearer token from e-post$epost = newEPost($key);

Send SMS

useEPost\SMS;
$sms = newSMS();
$sms->setPhone('93465221'); // 8-digit HK number (852 added automatically)$sms->setContent('Hello');
// Optional: set a different country code (default: 852)// $sms->setCountryCode('86'); // e.g. mainland China$smsId = $epost->sendSMS($sms);
echo"Sent! sms_id: $smsId";

sendSMS() returns the sms_id (int) on success, or throws an Exception on error.

Get SMS Report

$from = '2026-05-01';
$to = '2026-05-28';
$report = $epost->getSMSReport($from, $to);
foreach ($reportas$row) {
echo$row['sms_id'] . ' | '
. $row['phone'] . ' | '
. $row['content'] . ' | '
. $row['created_time'] . PHP_EOL;
}

Each record contains: sms_id, phone, content, created_time, no_of_msg, receive_status, receive_time.

Get Quota & Expiry Date

echo$epost->getSMSQuota(); // int e.g. 1200echo$epost->getSMSExpiryDate(); // string e.g. "2394-08-26"

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

1 watching

Forks

Releases

Packages

Used by

Contributors

Languages