Download the PHP package mane-olawale/termii without Composer
On this page you can find all versions of the php package mane-olawale/termii. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download mane-olawale/termii
More information about mane-olawale/termii
Files in mane-olawale/termii
Package termii
Short Description A simple Object Oriented PHP Client for Termii SMS API.
License MIT
Homepage https://github.com/mane-olawale/termii
Informations about the package termii
Termii Client
A simple Object Oriented PHP Client for Termii SMS API.
Uses Termii API.
Requirements
- PHP >= 7.2
- Guzzlehttp ~6|~7
Installation
Via Composer.
PHP 7.2+:
You now have Termii Client installed in vendor/mane-olawale/termii
And an handy autoload file to include in your project in vendor/autoload.php
Basic usage of Termii client
Enhanced http response
Error handling
You can still treat the response as array
You can use foreach directly on list responses e.g history
, sender list
etc.
Note There are more helper methods to the response. Check out the full documentation here.
Sender
Getting Sender ID list
Uses Sender ID.
Note We didn`t add the Sender id and channel becuase they are optional and they can always be passed later on the client object or the SMS API handler.
Request Sender ID
Uses Request Sender ID.
SMS
Send Message
Uses Switch - Messaging.
Custom Sender ID or Channel
You can fetch the message resource right after.
Send Number
Uses Switch - Number.
Template
Uses Switch - Template.
Token
Send Token
Uses Send Token.
Custom Sender ID or Channel
Verify Token
Uses Verify Token.
For men and women of few words
Note The above example will make you send multiple requests. Use the below helpers instead.
Custom error handlers
Send In App Token
Uses Send In App Token.
Account insights
Balance
Uses Balance.
Inbox
Uses Inbox.
Search
Uses Search.
The search Api is used majorly for checking if a number is DND active, so there are two helper functions to ease the check
Note The above example will make you send multiple requests. Use the below helpers instead.
Status
Uses Status.
Http Manager
In some situations where you want to be responsible for handling the http requests that termii Client sends out, write your own http manager. if you do not use any http manager the client will use the bult-in guzzle manager.
You can set the Http Manager directly by passing it as the third argument of the client contructor
Set http manager using the setter method:
All versions of termii with dependencies
guzzlehttp/guzzle Version ~6|~7
mane-olawale/rest-response Version ^0.1.0