title: Is it possible to create a custom Alexa skill with Spring Boot https endpoint
body: <p>I am trying to create a Custom Alexa Skill without using Lambda.  As such, I have deployed a Spring Boot application to an AWS EC2 instance, setup an SSL certificate, and tested that the service is functional by using Postman to invoke it.  </p>
  
  <p>I then setup an Alexa skill as an "https" endpoint.  When I using the Test form on developer.amazon.com, I simply get back:</p>
  
  <blockquote>
    <p>The remote endpoint could not be called, or the response it returned was invalid.</p>
  </blockquote>
  
  <p>When I invoke the service directly with Postman, I get:</p>
  
  <p><div class="snippet" data-lang="js" data-hide="false" data-console="false" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-js lang-js prettyprint-override"><code>{
    "version": "1.0",
    "response": {
      "outputSpeech": {
        "type": "PlainText",
        "id": null,
        "text": "Hello, World.  I am a Spring Boot custom skill."
      },
      "card": {
        "type": "Simple",
        "title": "HelloWorld",
        "content": "Hello, World.  I am a Spring Boot custom skill."
      },
      "reprompt": null,
      "shouldEndSession": true
    },
    "sessionAttributes": null
  }</code></pre>
  </div>
  </div>
  </p>
  
  <p>My controller uses the Alexa Skill Set SDK.  Here's the code:</p>
  
  <pre><code>@RestController
  public class AlexaController  {
  
      @RequestMapping(value="/alexa", 
          method=RequestMethod.POST,
          produces=MediaType.APPLICATION_JSON_VALUE)
      public ResponseEntity&lt;SpeechletResponseEnvelope&gt; alexa(Model model) {
  
          String speechText = "Hello, World.  I am a Spring Boot custom skill.";
  
          SimpleCard card = new SimpleCard();
          card.setTitle("HelloWorld");
          card.setContent(speechText);
  
          PlainTextOutputSpeech speech = new PlainTextOutputSpeech();
          speech.setText(speechText);
  
  
          SpeechletResponse response = SpeechletResponse.newTellResponse(speech, card);
  
  
          SpeechletResponseEnvelope envelope = new SpeechletResponseEnvelope();
          envelope.setResponse(response);
          envelope.setVersion("1.0");
          envelope.setSessionAttributes(null);
  
          return new ResponseEntity&lt;SpeechletResponseEnvelope&gt;(envelope, HttpStatus.OK);
      }
  }   
  </code></pre>