Download the PHP package b00gizm/alexa-skill without Composer
On this page you can find all versions of the php package b00gizm/alexa-skill. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Informations about the package alexa-skill
alexa-skill-php
OOP wrappers for the Amazon Alexa Skill JSON interface.
Install via Composer
Example
Quickstart
Your first Alexa app in less than 10 lines of code!
The Alexa\Alexa
class contains several callback handlers to handle the different Alexa request types:
Your callbacks should either return a valid Alexa\Response
or NULL
if it does not know how to handle a request (more on that later).
Writing Your Own Handlers
A more sophisticated way to provide Alexa request handlers is to write own handler classes which implement one (or more) of the following interfaces:
Alexa\Handler\LaunchRequestHandler
Alexa\Handler\IntentRequestHandler
Alexa\Handler\SessionEndedHandler
Own request handlers must be registered with a Alexa\EventProcessor
instance:
You may have noticed that there is an array of intent handlers. When writing bigger apps with lots of intents, writing a custom handler for each intent may be the best solution to organize your code base and maintain testability.
Intent handlers are processed in the order as they come in. If a handler cannot handle a certain intent request, it should simply return NULL
to notify the processor to try the next intent handler. When an intent request could be handled successfully, it should return a valid Alexa\Response
object signal the processor that it should stop.
Please keep in mind that Alexa\Alexa
's callback handlers will be always be preferred and will override your registered custom handlers if you try to use both at once for some reason.
Autoloading
This library uses schmittjoh/serializer for serializing and deserializung, which itself relies on doctrine/common for annotation support. If you're getting weird serializer errors, please append this to your autolad.php
as a work around for the moment:
Maintainer
Pascal Cremer
- Email: [email protected]
- Twitter: @b00gizm
- Web: http://codenugget.co
License
The MIT License (MIT)
Copyright (c) 2016-2017 Pascal Cremer
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.