Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/norberttech/promosms-api
Fully object oriented api for PromoSMS.pl service
https://github.com/norberttech/promosms-api
Last synced: 29 days ago
JSON representation
Fully object oriented api for PromoSMS.pl service
- Host: GitHub
- URL: https://github.com/norberttech/promosms-api
- Owner: norberttech
- License: mit
- Created: 2013-06-11T21:06:25.000Z (over 11 years ago)
- Default Branch: master
- Last Pushed: 2022-11-06T09:09:26.000Z (about 2 years ago)
- Last Synced: 2024-10-10T18:15:42.694Z (about 1 month ago)
- Language: PHP
- Size: 16.6 KB
- Stars: 0
- Watchers: 2
- Forks: 2
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE.md
Awesome Lists containing this project
README
#Fully object oriented api for PromoSMS.pl service
Api is under development but you can install it via composer.
```yml
"require": {
"norzechowicz/promosms-api": "1.0.x-dev"
}
```Following code is an example how to send sms and get delivery report.
```php
setReceiver('123123123');
$sms->setMessage('This new message');$response = $client->send($sms);
if ($response->isValid()) {
// Get sms delivery report
$report = $client->report($response->getId());
echo "SMS id: " . $response->getId() . "\n";if ($report->isReceived()) {
echo "SMS was received at: " . $report->getTime()->format('Y-m-d H:i:s') . "\n";
} else {
echo "SMS wasn't received yet. Please check later.\n";
}
} else {
// If something went wrong check the status
// Full status list is available here: http://dev.promosms.pl/sms-api/HTTP_SSL_API#Statusy_zwracane_przez_system
echo "Error status code: " . $response->getStatus();
}```
Following code is an example how to check account ballance.
```php
balance()->getAmount() / 100 . "\n";
```###TODO
* Add MaxSMS support
* Add FasterSMS support
* Add feature to check how many sms will be sent for text message content.