nikba / sms.md-php-api
SMS.MD API PHP SDK
v1.1
2023-10-13 07:53 UTC
Requires
- php: >=7.2
- guzzlehttp/guzzle: ^6.4 || ^7.4
README
Send SMS using sms.md
ServiceSMS messaging in Moldova - Build a reliable and effective connection with customers using the capabilities of sms.md
Installation
SmsMd requires PHP v5.4+ to run.
Require this package with Composer in the root directory of your project.
composer require nikba/sms.md-php-api
Usage
Create a new instance with your API key:
$sms = new \Nikba\SmsMdPhpApi\SmsMd('API_TOKEN');
Send Single sms message
Parameters:
- Phone Number
- Message
- Sender alias
$sms->send("37360820825", "Hello World!", "Nikba Creative Studio");
Get Balance
$sms->getBalance();
Get Messages List
Parameters:
- Page
- Date From (01.07.2022)
- Date To (20.07.2022)
- Status (1-Pending, 2-Sent, 3-Delivered, 9-Error)
$sms->getMessages(1,"01.07.2022", "20.07.2022", "2");
Get Message by id
Parameters:
- id
$sms->getMessage("449d5410-82d3-4b6e-96bc-cc92a33eb3f5");
Get Messages Statuses
$sms->getMessageStatuses();
Server response
[ { "id": 1, "name": "Ждет отправки", "description": "Отложенная отправка" }, { "id": 2, "name": "Отправлено", "description": "Отправлено оператору" }, { "id": 3, "name": "Доставлено", "description": "Доставдено оператором" }, { "id": 4, "name": "Повторная отправка", "description": "Ошибка при отпрвке, ошибка позволяет отправить еще раз" }, { "id": 5, "name": "У оператора", "description": "У оператора в очереди" }, { "id": 9, "name": "Ошибка отправки", "description": "Не отправлено оператором" } ]
Get all Contacts
Parameters:
- Page
$sms->getContacts(1);
Get all address books
Parameters:
- Page
$sms->getAddressBooks(1);
Get all address book contacts
Parameters:
- Id
- Page
$sms->getAddressBookContacts("449d5410-82d3-4b6e-96bc-cc92a33eb3f5", 1);
Get all sender aliases
$sms->getSenderAliases();
Get Stats
$sms->getStats();
License
MIT Free Software, Hell Yeah!