Download the PHP package eristemena/dialogflow-fulfillment-webhook-php without Composer

On this page you can find all versions of the php package eristemena/dialogflow-fulfillment-webhook-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 dialogflow-fulfillment-webhook-php

Dialogflow Fulfillment PHP Library

Latest Version on Packagist Build Status codecov StyleCI Monthly Downloads

This Library is inspired by dialogflow/dialogflow-fulfillment-nodejs.

It supports Dialogflow's fulfillment webhook JSON requests and responses for v1 and v2 agents.

For full class reference please refer to the doc.

Installation

Install via composer: composer require eristemena/dialogflow-fulfillment-webhook-php.

Usage

Initiate Agent

To initiate agent, use \Dialogflow\WebhookClient constructor with input parameter as array of request coming from Dialogflow.

In Vanilla PHP, this can be done as follow,

or if you're using Laravel,

Get Request Info

Send Reply

To send a reply, use reply() method.

Then use render() to get response in array. All you have to do is to print the array as JSON,

or in Laravel,

The response payload will be automatically formatted according to Agent Version of the request.

Rich Message

Text

Image

Card

Suggestion

Custom payload

Actions on Google

This library also supports Actions on Google specific functionalities. It's still under development, so more features will be added in the future.

To use Actions on Google Dialogflow Conversation object, you must first need to ensure the requestSource is coming from Google Assistant,

or you can just call getActionConversation() method, and it will return null if the request doesn't come from Google Assistant.

Send Reply

Using Dialogflow Conversation object, you can send a reply in two ways,

  1. Send a reply and close the conversation

  2. Send a reply and wait for user's response

Responses

Simple Response

Please see the documentation here.

Image
Basic Card

Please see the documentation here.

List

Please see the documentation here.

The single-select list presents the user with a vertical list of multiple items and allows the user to select a single one. Selecting an item from the list generates a user query (chat bubble) containing the title of the list item.

To capture the option selected by user, create a Dialogflow intent with the actions_intent_OPTION event. Assuming you name the intent as Get Option, you can get the argument as follow,

Carousel

Please see the documentation here.

The carousel scrolls horizontally and allows for selecting one item. Compared to the list selector, it has large tiles-allowing for richer content. The tiles that make up a carousel are similar to the basic card with image. Selecting an item from the carousel will simply generate a chat bubble as the response just like with list selector.

To check if the user granted you the information and then access the data, create a Dialogflow intent with the actions_intent_OPTION event. Assuming you name the intent as Get Option, you can get the argument as follow,

Browsing Carousel

Please see the documentation here.

A browsing carousel is a rich response, similar to the carousel response as it scrolls horizontally and allows users to select a tile. Browsing carousels are designed specifically for web content by opening the selected tile in a web browser (or an AMP browser if all tiles are AMP-enabled). The browsing carousel will also persist on the user's Assistant surface for browsing later.

No follow-up fulfillment is necessary for user interactions with browse carousel items, since the carousel handles the browser handoff.

Suggestion Chip

Please see the documentation here.

Media Responses

Please see the documentation here.

Media responses let your Actions play audio content with a playback duration longer than the 120-second limit of SSML. The primary component of a media response is the single-track card.

Helpers

User information

Please see the documentation here.

To check if the user granted you the information and then access the data, create a Dialogflow intent with the actions_intent_PERMISSION event. Assuming you name the intent as Get Permission, you can get the information as follow,

Date and Time

Please see the documentation here.

To check if the user granted access and then access the data, create a Dialogflow intent with the actions_intent_DATETIME event. Assuming you name the intent as Get Date Time, you can get the information as follow,

Place and Location

Please see the documentation here.

To check if the user granted access and then access the data, create a Dialogflow intent with the actions_intent_PLACE event. Assuming you name the intent as Get Place, you can get the information as follow,

Confirmation

Please see the documentation here.

To check if the user confirmed or not, create a Dialogflow intent with the actions_intent_CONFIRMATION event. Assuming you name the intent as Get Confirmation, you can get the information as follow,

Surface Capabilities

Google Assistant can be used on a variety of surfaces such as mobile devices that support audio and display experiences or a Google Home device that supports audio-only experiences.

To design and build conversations that work well on all surfaces, use surface capabilities to control and scope your conversations properly.


All versions of dialogflow-fulfillment-webhook-php with dependencies

PHP Build Version
Package Version
Requires php Version >=5.4
nesbot/carbon Version 1.* || 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 eristemena/dialogflow-fulfillment-webhook-php contains the following files

Loading the files please wait ....