PHP code example of vasily-kartashov / alexa-skills-kit-model

1. Go to this page and download the library: Download vasily-kartashov/alexa-skills-kit-model library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

vasily-kartashov / alexa-skills-kit-model example snippets


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

$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);