PHPackages                             20steps/api-ai-webhook-php - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [API Development](/categories/api)
4. /
5. 20steps/api-ai-webhook-php

ActiveLibrary[API Development](/categories/api)

20steps/api-ai-webhook-php
==========================

API AI Webhook interface for PHP

579PHP

Since Aug 16Pushed 8y ago5 watchersCompare

[ Source](https://github.com/20steps/api-ai-webhook-php)[ Packagist](https://packagist.org/packages/20steps/api-ai-webhook-php)[ RSS](/packages/20steps-api-ai-webhook-php/feed)WikiDiscussions master Synced 3d ago

READMEChangelogDependenciesVersions (1)Used By (0)

API AI Webhook PHP Library
==========================

[](#api-ai-webhook-php-library)

This library provides a convient interface for developing Webhooks for API AI and Google Assistant.

Info
----

[](#info)

Work in progress.

Capabilities:

- Basic serialization/deserialization
- Basic support for rich responses for Google Assistant

Usage
-----

[](#usage)

Install via composer: `composer require 20steps/api-ai-webhook-php`.

### Requests

[](#requests)

When API AI triggers your webhook, a HTTP request will be sent to the URL you specified for your app.

You can get the `JSON` body of the request like so:

```
$rawData = $request->getContent(); // This is how you would retrieve this with Laravel or Symfony 2.
$request = new \APIAI\Request\Request($rawData);
$request = $request->fromData();
```

The library expect raw request data, not parsed JSON as it needs to validate the request signature.

You can determine the type of the request with `instanceof`, e.g.:

```
if ($apiaiRequest instanceof IntentRequest) {
	// Handle intent here
}
```

### Response

[](#response)

You can build an APIAI response with the `Response` class. You can optionally set a display text or add basic cards for Google Assistant.

Here's a few examples.

```
$response = new \APIAI\Response\Response('my-assistant');
$response->respond('Cooool. I\'ll lower the temperature a bit for you!')
	->withDisplayText('Temperature decreased by 2 degrees')
	->withCard('My card title','My formatted text')
```

To output the response, simply use the `->render()` function, e.g. in Laravel you would create the response like so:

```
return response()->json($response->render());
```

In vanilla PHP:

```
header('Content-Type: application/json');
echo json_encode($response->render());
exit;
```

###  Health Score

23

—

LowBetter than 27% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity14

Limited adoption so far

Community9

Small or concentrated contributor base

Maturity41

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

### Community

Maintainers

![](https://www.gravatar.com/avatar/b7601e5458b38b514ef7c696075cb349670c50ec0a8a1f8440b68b6df32f230a?d=identicon)[helmuthva](/maintainers/helmuthva)

---

Top Contributors

[![helmut-hoffer-von-ankershoffen](https://avatars.githubusercontent.com/u/1826050?v=4)](https://github.com/helmut-hoffer-von-ankershoffen "helmut-hoffer-von-ankershoffen (18 commits)")

### Embed Badge

![Health badge](/badges/20steps-api-ai-webhook-php/health.svg)

```
[![Health](https://phpackages.com/badges/20steps-api-ai-webhook-php/health.svg)](https://phpackages.com/packages/20steps-api-ai-webhook-php)
```

###  Alternatives

[stripe/stripe-php

Stripe PHP Library

4.0k143.3M480](/packages/stripe-stripe-php)[twilio/sdk

A PHP wrapper for Twilio's API

1.6k92.9M272](/packages/twilio-sdk)[knplabs/github-api

GitHub API v3 client

2.2k15.8M187](/packages/knplabs-github-api)[facebook/php-business-sdk

PHP SDK for Facebook Business

90121.9M34](/packages/facebook-php-business-sdk)[meilisearch/meilisearch-php

PHP wrapper for the Meilisearch API

73813.7M114](/packages/meilisearch-meilisearch-php)[google/gax

Google API Core for PHP

263103.1M454](/packages/google-gax)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
