Download the PHP package quince/kavenegar-client without Composer
On this page you can find all versions of the php package quince/kavenegar-client. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download quince/kavenegar-client
More information about quince/kavenegar-client
Files in quince/kavenegar-client
Package kavenegar-client
Short Description A php client for connecting to kavenegar.com api for sending sms.
License MIT
Informations about the package kavenegar-client
Kavenegar PHP Client
A php client for connecting to kavenegar.com api for sending sms.
Installation
You must then modify your composer.json
file and run composer update
to include the latest version of the package in your project.
Or you can run the composer require command from your terminal.
Usage
Laravel integration
Laravel 5.1 and above is supported in this package.
Add the following line to your laravel config/app.php
:
Then run the following in your command line
A config file named kavenegar.php
can be found in config
folder. Configure you api key and default sender number if you want.
Laravel usage
By using laravel service provider you can automatically bindthe Client in your classes constructor.
Methods description
Client::send()
Send a message to specified receptor phone number.
Parameters | type | description |
---|---|---|
receptor | string|string[] | receptor or receptors phone number |
message | string | The text to send |
date | int | (optional) Setting the time to send the message in timestamp |
type | int | (optional) Type of the sms look here |
localId | string | (optional) Custom id for message |
sender | string | (optional) senders number, if it is set while building client no need to feel this. the given number will overwrite the default number for this action |
Client::bulkSend()
Send bulk messages to multiple receptor phone numbers.
Parameters | type | description |
---|---|---|
receptors | string[] | receptors phone number |
message | string|string[] | The text or texts to send, if array of texts passed, number of texts and receptors should be equal, and each text will send to corresponding receptor |
date | int | (optional) Setting the time to send the message in timestamp |
type | int|int[] | (optional) Type of the sms look here |
localId | string|string[] | (optional) Custom id for message |
sender | string|string[] | (optional) senders number, if it is set while building client no need to feel this. the given number will overwrite the default number for this action |
Client::getMessageStatus()
Get status of a sent message by its message id.
Parameters | type | description |
---|---|---|
messageId | string|string[] | Message id that given to you when sent a message |
Client::getMessageStatusByLocalId()
Get status of a sent message by local id set when sending.
Parameters | type | description |
---|---|---|
localId | string|string[] | Message id you set when sending a message |
Client::getMessageDetail()
Get details of a message by message id.
Parameters | type | description |
---|---|---|
messageId | string|string[] | Message id you set when sending a message |
Client::getOutbox()
Get all sent message in specified date range (max 3000 message).
Parameters | type | description |
---|---|---|
startDate | int | Start date in timestamp |
endDate | int | (optional) End date in timestamp |
sender | string | (optional) senders number, if it is set while building client no need to feel this. the given number will overwrite the default number for this action. If you sent message from multiple line number set sender number as set it 0 to bring outbox of all sender numbers. |
Client::getRecentOutbox()
Get list of recent sent messages (max 3000 messages).
Parameters | type | description |
---|---|---|
pageSize | int | (optional) number of message per request. |
sender | string | (optional) senders number, if it is set while building client no need to feel this. the given number will overwrite the default number for this action. If you sent message from multiple line number set sender number as set it 0 to bring outbox of all sender numbers. |
Client::getOutboxCount()
Get count of sent message in specified range.
Parameters | type | description |
---|---|---|
startDate | int | Start date in timestamp |
endDate | int | (optional) End date in timestamp |
sender | string | (optional) senders number, if it is set while building client no need to feel this. the given number will overwrite the default number for this action. If you sent message from multiple line number set sender number as set it 0 to bring outbox of all sender numbers. |
Client::cancelMessage()
Canceling a pending message from sending.
Parameters | type | description |
---|---|---|
messageId | string | Message id that given to you when sent a message |
Client::getInbox()
Get list of received messages (100 messages per each request).
Parameters | type | description |
---|---|---|
onlyRead | bool | (optional) If set to true only read messages would fetched |
line | string | (optional) senders number, if it is set while building client no need to feel this. the given number will overwrite the default number for this action. If you sent message from multiple line number set sender number as set it 0 to bring outbox of all sender numbers. |
Client::getInboxCount()
Get count of messages in inbox.
Parameters | type | description |
---|---|---|
startDate | int | Start date in timestamp |
endDate | int | (optional) End date in timestamp |
line | string | (optional) senders number, if it is set while building client no need to feel this. the given number will overwrite the default number for this action. If you sent message from multiple line number set sender number as set it 0 to bring outbox of all sender numbers. |
onlyRead | bool | (optional) If set to true only read messages would fetched |
Client::phoneCountByPostalCode()
Get count of phone numbers in a postal code area, categorized by oprator.
Parameters | type | description |
---|---|---|
postalCode | string | Postal code for an area |
Client::sendByPostalCode()
Send message to phone numbers in a postal code area.
Parameters | type | description |
---|---|---|
postalCode | string | Postal code for an area |
message | string | Text message to send |
mciStartIndex | int | Start index of MCI receptors, if set to -1 receptor selects randomely |
mciCount | int | Count of message to send to MCI receptors, if set to 0 (and start index set to 0 too) will send to all |
mtnStartIndex | int | Start index of MTN receptors, if set to -1 receptor selects randomely |
mtnCount | int | Count of message to send to MTN receptors, if set to 0 (and start index set to 0 too) will send to all |
date | int | (optional) Time to send in timestamp format |
sender | string | (optional) senders number, if it is set while building client no need to feel this. the given number will overwrite the default number for this action |
Client::getAccountInfo()
Get information of an account.
Client::getAccountConfigs()
Get configuration of an account.
Client::setAccountConfigs()
Set configuration of an account.
Parameters | type | description |
---|---|---|
configs | array | list of changing configurations in an array |
Config | type | description |
---|---|---|
apilogs | string | Status of logging API requests; values: justfaults (default), enabled , disabled |
dailyreport | string | Status of daily report; values: enabled , disabled |
debugmode | string | Status of debiging/testing mode, when enabled message sending will be mocked; values: enabled , disabled |
defaultsender | string | The default sender number |
mincreditalarm | int | The limit to alert when the credit is about to finish |
resendfailed | string | Whether try to redend when sending failed or not; values: enabled , disabled |
Client::sendVerificationCode()
Send vrification code, password, authorization code, etc.
Parameters | type | description |
---|---|---|
receptor | string | Receptor phone number |
token | string | Verification code, password, or the token |
template | string | Template name you set in your panel |