Download the PHP package davidpiesse/facebook_messenger_php without Composer

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

Currently abandoned - Please use Marcel's Botman.io (its much better)

Facebook Messenger PHP Wrapper

This package is a wrapper around the majority of the functionality of the Facebook Messenger platform. A list of features not yet implemented is below.

This package is still in development; so please do submit pull requests / issues you are having.

Installation

Just use compser to bring it in.

Currently we are in dev mode so you may need to set in your composer.json

Demo

A demo project (Laravel based) is here In the meantime you can interact with a demo ChatBot created using this wrapper.

Search for @laravelmessengerbot in Facebook messenger and you can test a load of the function. Or go here https://www.facebook.com/laravelmessengerbot/

Todo

Things still to implement

Current dependencies are GuzzleHttp/Guzzle, rappasoft/laravel-helpers and illuminate/http. These allow the package to make easy requests to the FB Messenger API and also deal with arrays in a super amazing way.

License

MIT

Who to call for help

Just add an issue or send me an email at piesse [at] gmail [dot] com or on Twitter @mapdev

Sending Messages

Usage

To send messages to a user create an instance of the Messenger class and insert your token

and then to send a text message

Facebook API Link

Still writing this...

Incoming Webhook

For Facebook Messenger you provide a webhook URL for their API to contact your server when certain events occur. -Link-

Most of these revolve around incoming messages from a user; be it a text message, attachment, postback etc. these are all handled by the Callback object.

Pass in an array of data from the post request {in Laravel use }

The data incoming should look similar to this

The object parses all this information and allows you to easily retrieve it and determine what to do with it.

Structure

Below is a guide on how to find the data you want in the Callback object Within a normal Facbook Webhook POST request are two top level parameters:

To get at the data you must iterate to make sure you do not miss a batch of messages.

The Callback also has three methods , , and . These give you quick access to an array of of these specific types.

Within an 'entry' are a couple of properties and a array of

This array of entry messages is where all the real information is. There are two main parts to it. THe shell (EntryMessage) contains the and along with a .

It also provides you a set of boolean return methods to determine what type of message it is.

Each of these allow you to filter the type of message it is and access its or other dynamic property appropriately.

Read

If the message is of type Read then is set and is of type

Properties

Delivered

If the message is of type Read then is set and is of type

Properties

Authentication

If the message is of type Read then is set and is of type

Properties

Account Linking

If the message is of type Read then is set and is of type

Properties

Postback

If the message is of type Read then is set and is of type

Properties

Message

If the message is of type Read then is set and is of type

Properties

Echo

The same as except with some more properties attached.

Additional Properties

Examples

Here are some code snippets to get you started

As Laravel Collection is iuncluded it is a great way to delve into your callback easily


All versions of facebook_messenger_php with dependencies

PHP Build Version
Package Version
Requires guzzlehttp/guzzle Version ^6.2
rappasoft/laravel-helpers Version dev-master
nesbot/carbon Version ^1.21
illuminate/http Version ^5.3
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 davidpiesse/facebook_messenger_php contains the following files

Loading the files please wait ....