Download the PHP package brandchat/api-php without Composer

On this page you can find all versions of the php package brandchat/api-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 api-php

BrandChat API Client PHP implementation

Requirements

Help and docs

Installing

The recommended way to install the BrandChat API client is through Composer.

Next, run the Composer command to install the latest stable version of the BrandChat API:

You can then later update the BrandChat API using composer:

Quickstart guide

Configuring the framework

Before using the BrandChatApi framework, you need to initialise it with your bot's api key and bot identifier. Both of these can be found on the BrandChat dashboard menu for your bot after enabling the API for your bot.

Processing inbound events

Ensure that you've initialised the framework as above. Then, to handle an incoming event, register one or more handlers for different event types. In the following example, we'll handle inbound text messages, and send a reply to the user with "Hello world!"

Notes:

Sending a message

As before, please ensure that you have initialised the framework. Then, provided you have the user ID for a valid user (e.g. obtained from a previous inbound event), you can send a message to the user later.

In general, the preferred way to send messages to the user is by responding with one or more messages to a message event (as per Processing inbound events example above).

Sending messages asynchronously should only be done if:

Please note that different messaging platforms have different rules about asynchronous messages to users. WeChat, for example, only allows them in a 48 hour window since the user's last interaction with your bot. Facebook narrows that interaction window to 24 hours for most bots.

Web authentication

As always, please ensure that you have initialised the framework. Then, on the web route you've configured for authenticated web access as per the documentation, get the one-time code that is passed through, and use it to retrieve the user's profile. The following example assumes that you've configured your URL to pass through the one-time code in the code parameter of the query string.

Happy coding!


All versions of api-php with dependencies

PHP Build Version
Package Version
Requires php Version >=5.5
guzzlehttp/guzzle Version ~6.0
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 brandchat/api-php contains the following files

Loading the files please wait ....