Skip to content

vasily-kartashov/alexa-skills-kit-model

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

36 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Alexa Skill Kit Model

Build Status

This is a mapping between Alexa's request and response envelopes and PHP classes. There model library doesn't do any processing and is solely responsible for mapping only.

Reading request envelope

To read a json request execute

$data = json_decode($payload, true);
$envelope = RequestEnvelope::fromValue($data);

Writing response envelope

To create a json response use respective builders

$speech = PlainTextOutputSpeech::ofText("Plain text string to speak");
    
$response = Response::builder()
    ->withOutputSpeech($speech)
    ->withShouldEndSession(true)
    ->build();
    
$envelope = ResponseEnvelope::builder()
    ->withVersion("string")
    ->withResponse($response)
    ->build();
    
$payload = json_encode($envelope);

Composer

Use "vasily-kartashov/alexa-skills-kit-model"

ToDo

About

Amazon Alexa Skills Kit Model

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages