Skip to content

Instantly share code, notes, and snippets.

@jacksonfdam
Created September 2, 2017 16:12
Show Gist options
  • Save jacksonfdam/0b165f9469222453ff05676455914ba8 to your computer and use it in GitHub Desktop.
Save jacksonfdam/0b165f9469222453ff05676455914ba8 to your computer and use it in GitHub Desktop.
Lab 01 do API.ai
require_once __DIR__.'/vendor/autoload.php';
use ApiAi\Client;
try {
$client = new Client('access_token');
$query = $client->get('query', [
'query' => 'Hello',
]);
$response = json_decode((string) $query->getBody(), true);
} catch (\Exception $error) {
echo $error->getMessage();
}
<?php
/* API.ai Lab*/
require_once __DIR__.'/vendor/autoload.php';
use ApiAi\Client;
try {
$client = new Client('access_token');
$query = $client->get('query', [
'query' => 'Hello',
]);
$response = json_decode((string) $query->getBody(), true);
} catch (\Exception $error) {
echo $error->getMessage();
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment