Download the PHP package alserom/viber-php without Composer
On this page you can find all versions of the php package alserom/viber-php. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download alserom/viber-php
More information about alserom/viber-php
Files in alserom/viber-php
Package viber-php
Short Description Unofficial library to work with Viber REST API and for develop a bot for the Viber platform.
License MIT
Homepage https://github.com/alserom/viber-php
Informations about the package viber-php
PHP SDK for Viber REST API

Use this library to develop a bot for the Viber platform or simple work with Viber REST API.
Note: For work with Viber API, you must have an authentication token. Go to partners.viber.com, create bot account and get token.
Installation
For properly work with this package you do also need to install a PSR-17 request/response factory and PSR-18 HTTP Client.
You can find packages of these implementations here:
Example:
Usage
This page will just show you the basics. For advanced usage, please read the full documentation.
If you want to quickly try this library on practice, you can use the code from repository viber-bot-examples.
Create objects
Setting a Webhook
Sending message
Build a message from scratch:
Or use prepared entity:
Registering events (Viber callbacks) handlers
Handling Viber callbacks
Viber expecting you to return a response with HTTP status code 200 for be sure that callback was delivered.
Also, once a conversation_started
callback is received you can send a welcome message to the user by returning a response with a prepared message.
This package took care of this. The method \Alserom\Viber\Bot :: handle
will return the generated response, which remains simply to emit.
You can use nyholm/psr7-server
package or any alternative to create server requests from PHP superglobals.
You can use zendframework/zend-httphandlerrunner
package or any alternative to emitting PSR-7 responses.
TODO list
- Write documentation
- Create to more tests
- See
@TODO
tags in the code
Contributing
Pull requests are welcome.
Before you make a PR, be sure that your code is suited to be merged. Just run several scripts:
License
This project is licensed under the MIT License - see the LICENSE file for details.
See more
All versions of viber-php with dependencies
ext-json Version *
psr/http-message Version ^1.0
psr/http-factory Version ^1.0
psr/http-client Version ^1.0
psr/http-server-handler Version ^1.0
psr/cache Version ^1.0
psr/log Version ^1.0
symfony/validator Version ^4.2
symfony/options-resolver Version ^4.2