also see example.php
see: api.ai docs - Fulfillment
use _
instead of symbols (e.g. -
) or spaces in intent-names on api.ai
$helper_config["PARAMETER"]
PARAMETER | if true | default |
---|---|---|
log | logs input, compiled data, output and additional logs in log.json next to the helper.php | false |
intent-function | executes function with the intent-name from api.ai | false |
You can use log_out(TITLE, CONTENT);
(after include()
) to log additional things to log.json if you declared $helper_config["log"] = true;
.
$helper_config["intent-function"] = true;
include(PATH/TO/FILE.php);
$helper["PARAMETER"]
PARAMETER | type | description | example |
---|---|---|---|
audio | boolean | capability of audio output | true |
screen | boolean | capability of screen output | false |
timestamp | string | timestamp | "2017-09-30T11:08:03.526Z" |
query | string | input | "I like cookies" |
method | string | input method | "KEYBOARD" |
locale | string | locale | "en-US" |
userId | string | userId | "SLONXM2bnazxzrC3MQMr5nU7xeF9" |
conversationId | string | locale | "2617870626043" |
parameters | object | from api.ai resolved parameters | {type: "cookies", person: "I"} |
intent | string | intent | "like" |
global $helper;
$userId = $helper["userId"];
You can respond on prompts in different versions. For requirements check Actions on Google Guides - Responses
response type | code |
---|---|
simple response |
|
Basic Card |
|
List selector |
|
Carousel selector |
|
Suggestion Chips |
|
before calling carousel_selector();
or list_selector();
add each item:
addItem(TITLE, DESCRIPTION, IMG-URL, IMG-ALT-TEXT);
see example.php