This is a wrapper around TeleVoIPs API. The API is very minimal, so this implementation is fairly simple.
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.
You can 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());
}
To run the examples, you need the following:
php examples/send_message.php
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.
Thank you to phpdocker.io for making getting PHP environments effortless!