Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/android-sms-gateway/client-php
A PHP client library for sending and managing SMS messages via the SMS Gateway for Android™ API.
https://github.com/android-sms-gateway/client-php
android-sms api-client communication http-client messaging php php-library php-sdk psr-18 rest-api sms sms-api sms-gateway
Last synced: 3 months ago
JSON representation
A PHP client library for sending and managing SMS messages via the SMS Gateway for Android™ API.
- Host: GitHub
- URL: https://github.com/android-sms-gateway/client-php
- Owner: android-sms-gateway
- License: apache-2.0
- Created: 2023-12-08T05:00:40.000Z (about 1 year ago)
- Default Branch: master
- Last Pushed: 2024-11-04T23:23:07.000Z (3 months ago)
- Last Synced: 2024-11-05T00:24:16.753Z (3 months ago)
- Topics: android-sms, api-client, communication, http-client, messaging, php, php-library, php-sdk, psr-18, rest-api, sms, sms-api, sms-gateway
- Language: PHP
- Homepage: https://sms.capcom.me
- Size: 199 KB
- Stars: 11
- Watchers: 2
- Forks: 4
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# SMS Gateway for Android™ PHP API Client
This is a PHP client library for interfacing with the [SMS Gateway for Android](https://sms.capcom.me) API.
## Requirements
- PHP 7.4 or higher
- A PSR-18 compatible HTTP client implementation## Installation
You can install the package via composer:
```bash
composer require capcom6/android-sms-gateway
```## Usage
Here is a simple example of how to send a message using the library:
```php
Send($message);
echo "Message sent with ID: " . $messageState->ID() . PHP_EOL;
} catch (Exception $e) {
echo "Error sending message: " . $e->getMessage() . PHP_EOL;
die(1);
}try {
$messageState = $client->GetState($messageState->ID());
echo "Message state: " . $messageState->State() . PHP_EOL;
} catch (Exception $e) {
echo "Error getting message state: " . $e->getMessage() . PHP_EOL;
die(1);
}
```## Client
The `Client` is used for sending SMS messages in plain text, but can also be used for sending encrypted messages by providing an `Encryptor`.
### Methods
The `Client` class has the following methods:
* `Send(Message $message)`: Send a new SMS message.
* `GetState(string $id)`: Retrieve the state of a previously sent message by its ID.# Contributing
Contributions are welcome! Please submit a pull request or create an issue for anything you'd like to add or change.
# License
This library is open-sourced software licensed under the [Apache-2.0 license](LICENSE).