Alexa Custom Task Quick Link

amazon-alexa

#1

With Alexa Quick Links announced last week, you can launch a skill from a website via a link (or url). To pass data or analytics info in the link, you must define a custom task.

To create a custom task, you must use ASK CLI v2 and the project structure has changed:
https://developer.amazon.com/en-US/docs/alexa/custom-skills/implement-custom-tasks-in-your-skill.html#create-a-task-definition-file

The challenge is that Jovo requires ASK CLI v1.7.23 and won’t work with v2.

@AlexSwe @jan Do you have a solution so that we can start using Custom Tasks and Custom Task Quick Links?


#2

Hey @marktucker! The Jovo CLI does support ASK CLI v2 now: https://github.com/jovotech/jovo-cli/pull/137


#3

@jan @rubenaeg After updating to ask-cli v2.13.0 and jovo-cli v3.0.21, do I need to change the structure of my project?

Can I still keep this project structure?

image


#4

Looks like I need to run jovo build with the --clean option to get the new structure:

image


#5

Hi @marktucker,

Yes, or run $ ask util upgrade-project according to https://developer.amazon.com/en-US/docs/alexa/smapi/ask-cli-v1-to-v2-migration-guide.html


#6

I am following the docs for:

Here is a link to the CountDown.1.json file.

I added the following to project.js:

module.exports = {
  alexaSkill: {
    nlu: {
      name: 'alexa',
      lang: {
        en: ['en-US'],
      },
    },
    manifest: { 
      apis: {
        custom: {
          tasks: [
            {
              name: 'CountDown',
              version: '1',
            },
          ],
        },
      },
    },
  },

And when that builds, it is added to skill.json:

		"apis": {
			"custom": {
				"endpoint": {
					"sslCertificateType": "Wildcard",
					"uri": "https://webhook.jovo.cloud/42exxx"
				},
				"tasks": [
					{
						"name": "CountDown",
						"version": "1"
					}
				]
			}
		},

First, I executed the following command:
jovo deploy -p alexaSkill --stage local -t info

The command executed with no errors, but then when I tried to execute this command:
ask smapi get-task -s amzn1.ask.skill.c27xxx --task-name amzn1.ask.skill.c27xxx.CountDown --task-version 1

I got this message:

[Error]: {
  "message": "No task details for given name and taskVersion found."
}

But when I execute this command:
jovo deploy -p alexaSkill --stage local

I get the following error:

jovo deploy: Deploys the project to the voice platform.
   >> Learn more: https://jovo.tech/docs/cli/deploy

  > Deploying Alexa Skill (stage: local)
    ↓ Updating Alexa Skill project for ASK profile myprofile [skipped]
      → Endpoint: https://webhook.jovo.cloud/42exxx
    > Deploying Interaction Model, waiting for build
      × en-US
      Enabling skill for testing
 »   Error: There was a problem:
 »
 »   [ERR] smapiUpdateInteractionModel:Interaction model is not valid.
 »
 »   Module:   jovo-cli-platform-alexa
 »   Hint:     InvalidTaskManifestEntry: Definition for tasks in skill manifest not found: <[amzn1.ask.skill.c27xxx.CountDown/1]>.
 »

#7

@jan
Why is the deployment of tasks part of the deployment of the Interaction Model if tasks are defined in skill.json?

If I run this command, it also tries to deploy tasks:
jovo deploy -p alexaSkill --stage local -t model


#8

Hey @marktucker,

where do you store the task file? I don’t think jovo build supports Custom Tasks yet, so you’ll need to add the task file to the skill package manually.


#9

So I read a bit more about Custom Tasks and experimented with it a bit, and so far the only solution that works for me is copying the task file to ./platforms/alexaSkill/skill-package/tasks/ and run ask deploy inside of the platforms folder. Even if the Jovo CLI would support building Custom Tasks, there is currently no way of deploying it with the ask CLI other than with ask deploy, which we don’t use for deployment. So currently I’d suggest to do all task-specific development inside of the platforms folder using the ask CLI until we find a better solution for this or Amazon provides a better way of deploying Custom Tasks.


#10

@rubenaeg Thanks for looking into it. I was able to get ask deploy to work once for the first task and it was certified. Now I am having issues adding a second task.

Please add a supportive comment on this Issue for the ASK CLI team:


#11

Thank you @marktucker for the initiative! Seems like they already forwarded your request to the SMAPI team


#12

@jan
Now that my Jovo project is converted to the new ASK v2 folder structure (under the platforms/alexaSkill folder), does jovo build update the new ask-resources.json and .ask/ask-states.json files like it did the old .ask/config file?


#13

I think @rubenaeg or @AlexSwe can speak better to this, but in the past, the Jovo CLI only touched the Skill ID in the .ask/config file.

What types of information would you like to see updated/have the possibility to override?


#14

.ask/config is now gone. The skill ID can now be found in .ask/ask-states.json so wondering if that is being updated yet by jovo build.


#15

Yes. Are you experiencing any issues with the build command and the new folder structure?


#16

Hi @marktucker.

You have an example to use Tasks with Jovo?


#17

Sorry for reviving this old thread, but it’s the only(!) one on the internet that mentions the error “No task details for given name and taskVersion found”. - Which is taunting me for days now trying to add a custom task to an existing skill.

As Alexa “quick links” only work with live-skills, i’m using the “ask smapi get-task (…)” method from the Alexa documentation to test if the custom task was added successfully.

I’m wondering if this already counts as “Direct skill connections” which requires registering for the preview and that’s the reason it doesn’t work?