Download the PHP package maxbeckers/amazon-alexa-php without Composer
On this page you can find all versions of the php package maxbeckers/amazon-alexa-php. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download maxbeckers/amazon-alexa-php
More information about maxbeckers/amazon-alexa-php
Files in maxbeckers/amazon-alexa-php
Package amazon-alexa-php
Short Description Php library for amazon echo (alexa) skill development.
License MIT
Informations about the package amazon-alexa-php
Amazon alexa php library
This library is a helper for amazon echo (alexa) skills with php. With this library it's very simple to handle alexa requests in your php application. You only create some handlers for the requests of your alexa skill and add them to a registry.
Install via composer
Require the package with composer:
Usage
Handle the request:
- map request data to request object
- validate request
- handle request data
- create response
- send response
Map request data to request object
Map needed request headers and request body to Request
.
Validate request
The RequestValidator
will handle the amazon request validation.
Register request handlers
For different requests it's helpful to create different RequestHandlers.
Use registry to handle request
Render response
Create a new request handler
The new request handler must extend AbstractRequestHandler
.
In constructor set the supportedApplicationIds
to your skill Ids.
Then implement the abstract supportsRequest
-method.
Then implement the handleRequest
-method. For simple responses there is a ResponseHelper
.
Check device address information
To get either "Full Address" or "Country & Postal Code" from the customer you need the permissions for user api call. More informations for the call see device-address-api.
Generate SSML
For SSML output you can use the SsmlGenerator
. With the helper will generate valid SSML for alexa. All types of alexa known SSML tags have a function in the SsmlGeneator
.
You can add all SSML you need to the generator and call getSsml
to get the full string.
Symfony Integration
There is also a symfony bundle on maxbeckers/amazon-alexa-bundle.