forward-force / televoips
PHP Wrapper around TeleVoIPs API
Installs: 3 159
Dependents: 0
Suggesters: 0
Security: 0
Stars: 0
Watchers: 2
Forks: 0
Open Issues: 0
Requires
- php: ^7.4
- ext-json: *
- guzzlehttp/guzzle: ^7.1@dev
- phpmd/phpmd: ^2.9.1
Requires (Dev)
- phpunit/phpunit: ^9.5@dev
- squizlabs/php_codesniffer: ^3.0@dev
- vimeo/psalm: ^4.0@dev
README
This is a wrapper around TeleVoIPs API. The API is very minimal, so this implementation is fairly simple.
Authentication
In order to authenticate you need a token from TeleVoIPs. Head over to the docs portal to read updated procedure as how to obtain one: https://documenter.getpostman.com/view/3155589/T1DtfbSY#intro
TeleVoIPs is likely to give you a toke and a secret, the API requires the token only.
Messages API
You can send a message.
How to send a message:
$televoips = new \ForwardForce\TeleVoIPs\TeleVoIPs('your-token'); try { $message = $televoips->message() ->setFrom('19876543210') ->setTo('9417264539') ->setMessage('Test SMS') ->send(); } catch (\GuzzleHttp\Exception\GuzzleException $e) { var_dump($e->getMessage()); }
How run the examples:
To run the examples, you need the following:
php examples/send_message.php
Contributions
To run locally, you can use the docker container provided here. You can run it like so:
docker-compose up
Then you can ssh into the php-fpm
container. Please note, you need to set your token as
environmental variables $TELEVOIPS_API_TOKEN
.
xdebug
is fully configured to work as cli, hookup your favorite IDE to it and debug away!
There is auto-generated documentation as to how to run this library on local, please take a look at phpdocker/README.md
If you find an issue, have a question, or a suggestion, please don't hesitate to open a github issue.
Acknowledgments
Thank you to phpdocker.io for making getting PHP environments effortless!