Download the PHP package weezqyd/africastalking without Composer
On this page you can find all versions of the php package weezqyd/africastalking. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download weezqyd/africastalking
More information about weezqyd/africastalking
Files in weezqyd/africastalking
Package africastalking
Short Description PHP Api gateway for AfricasTalking
License mit
Informations about the package africastalking
Geting Started
Install the package from composer
You then need to install one of the following: But we recomend GuzzleHttp
Configure the Adapter
This package uses guzzlehttp as the default adapter, if you decide to use another http client good for you all you need is to configure your client and pass the adapter as the fourth parameter to the gateway's constructor. You can also create your own adapter as long as it implements Http\Adapter\AdapterInterface
.
An example is worth a thousand words
Sending an SMS Message
Now let us send an SMS notification
Passing additional options
The SMS API accept additional options to be passed allong with the request
Parameter | Description |
---|---|
from | Shortcode or alphanumeric that is registered with your Africa's Talking account. If missing, the default value (20414) will be populated on the message |
enqueue | This parameter is used for Bulk SMS clients that would like deliver as many messages to the API before waiting for an Ack from the Telcos. If enabled, the API will store the messages in its databases and send them out asynchronously after responding to the request |
keyword | This parameter is used for premium services. It is essential for subscription premium services. |
linkId | This parameter is used for premium services to send OnDemand messages. We forward the linkId to your application when the user send a message to your service |
retryDurationInHours | This parameter is used for premium messages. It specifies the number of hours your subscription message should be retried in case it's not delivered to the subscriber. |
Send with options
Sending to multiple recipients
At times you would want to do somthing with the API response. Well worry no more. To acheive this pass a callback funtion as the fourth parameter of the sendMessage()
method. This callback will be run for each message that is sent