Anna K
Anna K

Reputation: 1774

Alexa ask-cli how to add a custom https server

I'm not able deploy alexa skill using alexa-cli tool (https://www.npmjs.com/package/ask-cli) when I try to deploy my skill with a https server

As an error I get:

  ◞  Creating new skill...Call create-skill error.
Error code: 400
{
  "message": "Skill manifest is not valid.",
  "violations": [
    {
      "message": "No default regionalized endpoint is defined."
    }
  ]
}

Im using an example skill.json from: https://github.com/alexa/skill-sample-nodejs-hello-world/blob/master/skill.json

A problem is how to add custom uri endpoint. I dont want to host my skill in AWS lambda function.

I tried to follow documentation: https://developer.amazon.com/de/docs/smapi/ask-cli-command-reference.html but I dont know what Im doing wrong...

Could sombody please take a look at my json and alexa-cli documentation? Why Im getting a such weird message?

"No default regionalized endpoint is defined."

?

{
    "manifest": {
        "publishingInformation": {
            "locales": {
                "en-US": {
                    "summary": "Sample Short Description",
                    "examplePhrases": [
                        "Alexa open hello world",
                        "Alexa tell hello world my name is bill",
                        "Alexa tell hello world I want to play"
                    ],
                    "name": "trivia",
                    "description": "Sample Full Description"
                }
            },
            "isAvailableWorldwide": true,
            "testingInstructions": "Sample Testing Instructions.",
            "category": "KNOWLEDGE_AND_TRIVIA",
            "distributionCountries": []
        },
        "apis": {
            "custom": {
                "endpoint": {
                    "sourceDir": "./lambda/custom",
                    "uri": "https://customapi.sampleskill.com",
                    "  sslCertificateType": "Wildcard"
                },
                "regions": {
                    "EU": {
                        "endpoint": {
                            "uri": "https://customapi.sampleskill.com",
                            "sslCertificateType": "Trusted"
                        }
                    }
                }
            }
        },
        "manifestVersion": "1.0"
    }
}

Upvotes: 1

Views: 837

Answers (2)

Anna K
Anna K

Reputation: 1774

Ok for those who faced that problem in the future ;) Important is that in your skill root directory you have that file:

.ask/config

It should look like:

{
  "deploy_settings": {
    "default": {
      "skill_id": "put here your skill id or leave it blank",
      "was_cloned": false,
      "merge": {
        "manifest": {
          "apis": {
            "custom": {
              "endpoint": {
                "uri": "https://yourhttps.de",
                "sslCertificateType": "Wildcard"
              }
            }
          }
        }
      }
    }
  }
}

after that you can use ask-cli with the https server as an endpoint :)

Upvotes: 2

Arif Gebhardt
Arif Gebhardt

Reputation: 111

Try this:

    "apis": {
        "custom": {
            "endpoint": {
                "uri": "https://customapi.sampleskill.com",
                "sslCertificateType": "Wildcard"
            },
            "regions": {
                "EU": {
                    "endpoint": {
                        "uri": "https://customapi.sampleskill.com",
                        "sslCertificateType": "Trusted"
                    }
                }
            }
        }
    }

In the default config you had set sourceDir which doesn't make much sense for endpoints outside AWS Lambda. Second your config contained whitespace around sslCertificateType, which also might cause the problem.

Upvotes: 1

Related Questions