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.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package viber-php

PHP SDK for Viber REST API Latest Stable Version Latest Unstable Version

Build Status Minimum PHP Version Coding Style

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

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

PHP Build Version
Package Version
Requires php Version ^7.1.3
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
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package alserom/viber-php contains the following files

Loading the files please wait ....