Build an Alexa skill that calls an external API - Dabble Lab #43

Поділитися
Вставка
  • Опубліковано 1 лис 2024

КОМЕНТАРІ • 57

  • @kutticchathan
    @kutticchathan 5 років тому +1

    Hi, I have been following exactly as suggested, but am getting the following error while deploying.
    [Error]: Get Lambda ARN arn:aws:lambda:eu-west-1:885625664603:function:ask-custom-random-quote-alexa-default failure for custom/default.
    Looks like it is expecting the lambda function to be available before deploying. Has the interface moved on? Any suggestions?
    Thanks,

  • @nappyheadedsloth8861
    @nappyheadedsloth8861 6 років тому +2

    This is amazing!!! I've been struggling so hard with this!

    • @dabblelab
      @dabblelab  6 років тому

      Thanks so much for the comment! I'm glad the video helped.

  • @TomPetryshen
    @TomPetryshen 6 років тому +1

    My son and I love what you and Dabble Lab are doing to simplify the skill building process. We noticed though that when running ask new --template --url skilltemplates.com/templates.json it only returned options for the Basic Starter and VideoApp Starter templates. There was no option to select the API Starter template. We were able to get around it by using the exact URL for the API Starter template but thought you should know the original has gone missing from the has done a runner.

    • @dabblelab
      @dabblelab  6 років тому

      Thanks for the comment Tom. I mistakenly removed the 'API Starter' option when I push an update to the site. It's fixed and available now. Thanks for the heads up! Also, I love hearing you're building skill with your son. I introduced my son to coding when he was about 8. Now he's 17 and I can't keep up with him anymore ;-)

  • @bprasanth6405
    @bprasanth6405 6 років тому

    Hi, i stuck in the problems.
    i am using https to retrieve the data. In one intent user ask the status of user, alexa prompt to ask the user id and search about the user.
    else if($EchoReqObj->request->intent->name =="status"){
    $text = "Please provide the id";
    $array = array("version"=>"1.0","response"=>array("outputSpeech"=>array("type"=>"PlainText","text"=>$text),"directives"=>array("type"=>"Dialog.ElicitSlot","slotToElicit"=>"id"),"shouldEndSession"=>false));
    echo json_encode($array);
    }
    This is the array i used to send the data but getting the error "problem with the skill".
    Kindly help me out from this problem.
    Thanks!

  • @Carlossanchez-yq9px
    @Carlossanchez-yq9px 4 роки тому

    This is a great video!,.. very similar to what I would like to do..Is it possible to get the index.js used in Dabble Lab #43...is this code posted?

    • @dabblelab
      @dabblelab  4 роки тому

      Hey Carlos, thanks for the nice comment! There is an updated tutorial here dabblelab.com/tutorials/creating-an-alexa-skill-that-calls-an-api that also has a code template you can download. I hope that helps and thanks again!

  • @zedyu7997
    @zedyu7997 6 років тому

    Hello Steve, I tried the example above and tried to apply it to an api I was trying to access. However I am getting this error: Process exited before completing request"... Wondering what I have done wrong :(... not sure its the location of where I have put the https request code or something else. Would you be so kind as to point me in the right direction to solving this issue I am experiencing?

  • @pavansai8105
    @pavansai8105 6 років тому

    hi can you please suggest how to integrate google spread sheet json link into the aws lambda function

  • @amulyab4229
    @amulyab4229 6 років тому

    Hi Dabble, this skill is amazing.This made me get some idea. I'm trying to pass some dynamic utterances to an intent(let say i'm passing an utterence with text as "show me details of employee 10") So i need the value 10 should be pass into my url in the place of id dynammically (apex.orc.com/apex/sam/:id) which is in my lambda function. I'm struggling with this.Can you please help me with this?

  • @BurnedOutGeek
    @BurnedOutGeek 6 років тому

    What is the terminal add-on for Atom that you use in your videos? I have been searching for it and can't find the right one! :)

    • @dabblelab
      @dabblelab  6 років тому

      Hey Mark, it's platformio-ide-terminal (atom.io/packages/platformio-ide-terminal). However, I've switched from Atom to Visual Studio Code (code.visualstudio.com) as my current IDE of choice. They're both based on ElectronJS (electronjs.org) so they're very similar, but Code has the terminal included and other really nice features like code-completion / intellisense that's super helpful. If you haven't checked it out it's worth dabbling with.

  • @sohailshaik2410
    @sohailshaik2410 6 років тому

    Hi Steve , cant we do the same by directly uploading the zip(node modules, index.js and package.json) rather than doing that with the ASK-CLI
    Thanks

    • @dabblelab
      @dabblelab  6 років тому

      Hi Sohail. Yes, you can directly upload a .zip package using the AWS web console. I prefer the ASK-CLI but either way works.

  • @cyberspace3853
    @cyberspace3853 6 років тому

    Great Vid, do you have a template for alexa smart hoem skill, using external api ?

    • @dabblelab
      @dabblelab  6 років тому

      Thanks! No, unfortunately I don' t have a smart home skill template yet. That's one I'd love to have sometime soon.

  • @nithishgupta
    @nithishgupta 6 років тому

    Thanks for the video I followed the instructions and when I tried to deploy this is the error is get and im on windows machine
    Skill Id: ##############################
    Skill deployment finished.
    Model deployment finished.
    [Warn]: Lambda deployment skipped because AWS credentials for profile [default] are missing. CLI lambda functionalities can be enabled by running `ask init` again to add 'aws_profile' to ASK cli_config
    No in-skill product to be deployed.
    Call enable-skill error.
    Error code: 403
    {
    "message": "Skill is not ready for enablement.",
    "violations": [
    {
    "message": "custom - object has missing required properties ([\"endpoint\"])"
    }
    ]
    }

  • @georgedlake
    @georgedlake 6 років тому +1

    hi. I cant seem to get the still to work other then saying alexa open api starter. If I want the names of the space ships they are on... how would I be able to get that and the number of astronauts as separate commands?

    • @dabblelab
      @dabblelab  6 років тому

      Hi George. This skill is a really simple example. But, if you wanted to expand it like you're suggesting you'd need to code an intent for each command and associate it with the phrase / utterance the user would speak to trigger that intent. Does that make sense?

    • @georgedlake
      @georgedlake 6 років тому

      It does. I have created a new skill based on this example, but I still have to say "Alexa Open ESP Chip" then Alexa will responde "What do you want to know" and finally I can say "what is room temperature". I would love just to say "Alexa what is the room temperature". Not "open" the skill each time.

  • @garrettmilovich1794
    @garrettmilovich1794 6 років тому

    Thanks for the tutorial! I'm working on a project where the URL is based on input from the user. For instance, "Alexa, what is the definition of shoe?" Then Alexa would make a specific API request (www.{website}.com/shoe) and response. How would I set that up?

    • @dabblelab
      @dabblelab  6 років тому

      Hi Garrett. You could use a "catch all" path variable with AWS APIGateway to do that. Here is a link with more details aws.amazon.com/blogs/aws/api-gateway-update-new-features-simplify-api-development/ - I hope that helps.

  • @ygaming
    @ygaming 6 років тому

    Thanks for the video first of all. I'm totally new to this so can you please guide me into installing the ASK CLI. I have node.js installed but after that I can't seem to figure out how to proceed. I ran the "npm install -g ask-cli" command and it installed without any errors. Now where do I initialize ASK with "ask init"? The command prompt is giving an error so I guess not there, sorry but I'm a newbie.

    • @ygaming
      @ygaming 6 років тому

      Okay, so I had to open Node.js command prompt, dumb me. Now I have this error when I enter API Starter after "ask new --template --url skilltemplates.com/templates.json"
      Error: spawn git ENOENT
      at exports._errnoException (util.js:1022:11)
      at Process.ChildProcess._handle.onexit (internal/child_process.js:193:32)
      at onErrorNT (internal/child_process.js:359:16)
      at _combinedTickCallback (internal/process/next_tick.js:74:11)
      at process._tickDomainCallback (internal/process/next_tick.js:122:9)

    • @dabblelab
      @dabblelab  6 років тому +1

      Hi and thanks for the comment. Never have any worries about asking questions when you're getting started - that's how we ALL learn! Anyhow, this issue you're having is because you also need the Git client installed and it seems you don't. Here is a link to where you can get it. git-scm.com/downloads - I hope that helps!

    • @ygaming
      @ygaming 6 років тому

      Thanks for the help, if I have any more problems I know where to come :D

    • @ygaming
      @ygaming 6 років тому

      Alright, so now when I'm trying to deploy it is giving out this error. Am I missing something in between that I need to do?
      Skill Id: _________________________
      Skill deployment finished.
      Model deployment finished.
      [Warn]: Lambda deployment skipped, since AWS credentialsfor profile: [default] is missing. CLI lambda functionalities can be enabled by running `ask init` again to add 'aws_profile' to ASK cli_config
      Call enable-skill error.
      Error code: 403
      {
      "message": "Skill is not ready for enablement.",
      "violations": [
      {
      "message": "Regionalized endpoints must not be empty."
      }
      ]
      }

    • @dabblelab
      @dabblelab  6 років тому

      Now your AWS profile is missing / not configured. See the steps here for fixing this... developer.amazon.com/docs/smapi/set-up-credentials-for-an-amazon-web-services-account.html

  • @santhanamp
    @santhanamp 6 років тому

    Hi, how do we integrate the account linking with your api-starter project

    • @dabblelab
      @dabblelab  6 років тому

      Hi Santhanam. Integrating account linking can get a bit involved but I'm hoping to get the time to do a video on that topic soon. When I do, I'll also provide code samples and a skill template. So, stay tuned.

  • @sitcomrave
    @sitcomrave 6 років тому

    cool . this made me so clear .

    • @dabblelab
      @dabblelab  6 років тому

      I'm very glad to hear that Vamshi and thanks for the feedback!

  • @akashanand
    @akashanand 6 років тому

    i'm getting error while running these
    C:\Users\Akash\Desktop\Temp-alexaAPI>ask new --template --url skilltemplates.com/templates.json
    [Error]: Cannot resolve profile [default]

    • @dabblelab
      @dabblelab  6 років тому

      Hi Akash. It sounds like your ASK CLI is not fully configured. Here is a like to a tutorial I did that walks through setting up the ASK CLI. skilltemplates.com/docs/getting-started/ Let me know if that helps.

  • @jdbohrman
    @jdbohrman 6 років тому

    I got at error `InvalidClientTokenId: The security token included in the request is invalid.` when deploying

    • @dabblelab
      @dabblelab  6 років тому

      Hey James, apologies for the slow reply - holidays got me a bit behind. Anyhow, are you still getting this error? If so, can you tell me when the error occurs? Asked another way, is there any response before the error?

  • @bondwhisperer
    @bondwhisperer 6 років тому

    I got wcf.js to work with a .net web service. I pass in two strings with soap get a return soap and use xml2js to convert it to JSON and then need to send this string value back to Alexa. Everything works but I can't get the variable to Alexa to speak. I can't find help on this anywhere. I put console.log lines in and the lines AFTER the proxy.send seem to be executing before the proxy.send is even finished. Pulling my hair out over here being I am so close to a solution. Anyone have a clue what is wrong?'SayHello': function () {
    console.log("start");
    var stringspeech;
    var parseString = require('xml2js').parseString;
    var BasicHttpBinding = require('wcf.js').BasicHttpBinding
    , Proxy = require('wcf.js').Proxy
    , binding = new BasicHttpBinding()
    , proxy = new Proxy (binding, "service.menofnoblegirth.com/service1.svc")
    , message = "" +
    "" +
    "" +
    "" +
    "test" +
    "test2" +
    "" +
    "" +
    ""
    proxy.send(message, "tempuri.org/IService1/GetData", function (response, ctx) {
    parseString(response, function(error, result) {
    console.log(JSON.stringify(result));
    var stringfun = JSON.stringify(result);
    var objectValue = JSON.parse(stringfun);
    console.log(objectValue["s:Envelope"]["s:Body"][0]["GetDataResponse"][0]["GetDataResult"][0]);
    stringspeech = objectValue["s:Envelope"]["s:Body"][0]["GetDataResponse"][0]["GetDataResult"][0];
    console.log("The variable stringspeech is now set to: " + stringspeech);
    });
    });
    console.log("The variable stringspeech is FINALLY set to: " + stringspeech);
    this.response.speak(stringspeech)
    .cardRenderer(stringspeech, stringspeech);
    this.emit(':responseReady');
    },

    • @dabblelab
      @dabblelab  6 років тому +1

      Hi Jason. My guess is that your issues has to do with the asynchronous nature of Node. The proxy.send method is probablly still working when the console.log fires. You'll need to do something like...
      SayHello': function () {
      console.log("start");
      var stringspeech;
      var parseString = require('xml2js').parseString;
      var BasicHttpBinding = require('wcf.js').BasicHttpBinding
      , Proxy = require('wcf.js').Proxy
      , binding = new BasicHttpBinding()
      , proxy = new Proxy (binding, "service.menofnoblegirth.com/service1.svc")
      , message = "" +
      "" +
      "" +
      "" +
      "test" +
      "test2" +
      "" +
      "" +
      ""
      proxy.send(message, "tempuri.org/IService1/GetData", (response, ctx) => {
      parseString(response, function(error, result) {
      console.log(JSON.stringify(result));
      var stringfun = JSON.stringify(result);
      var objectValue = JSON.parse(stringfun);
      console.log(objectValue["s:Envelope"]["s:Body"][0]["GetDataResponse"][0]["GetDataResult"][0]);
      stringspeech = objectValue["s:Envelope"]["s:Body"][0]["GetDataResponse"][0]["GetDataResult"][0];
      console.log("The variable stringspeech is now set to: " + stringspeech);
      console.log("The variable stringspeech is FINALLY set to: " + stringspeech);
      this.response.speak(stringspeech)
      .cardRenderer(stringspeech, stringspeech);
      this.emit(':responseReady');
      });
      });
      }
      I have not tested this code but basically you need to emit the response after the proxy.send completes. I hope that helps.

    • @bondwhisperer
      @bondwhisperer 6 років тому

      That's exactly what it is! Thanks for the reply I didn't know Node was async by default....who decided that was a good idea??....I'm looking into call backs now because it doesn't like me to do a this.response.speak inside the proxy.send function? Does the nature of THIS change when your in a new function? I wish I could just send the string to Alexa from inside this function. The whole notion of callbacks and functions passing functions makes my head spin. I didn't used to like JavaScript all that much but node.js has given me a new and deeper hatred for it. If I can ever get this over with I will do all my programming inside VB.NET WCF service and this code will be the go between with Alexa and my life will get 1000 times better.

    • @dabblelab
      @dabblelab  6 років тому

      I had a hard time wrapping my head around the Node callback stuff when I started using it. Most of what I'd been doing before was C# and async / await in C# made everything super simple. That said, I've become a big fan of Node now that I've gotten more familiar with it. For all of the frustrating things, there are other things that are really nice. Take a look at the async node module - it makes the callback stuff easier to deal with. Unfortunately, AWS Lambda only supports Node 6.1 but Node 8 added support for async / await so hopefully we'll be able to use that too . Anyhow, glad to hear your heading in the right direction.

    • @dabblelab
      @dabblelab  6 років тому

      One more thought. The idea of "scope" is a bit different in Javascript. Also spend a bit of time wrapping your head around "variable hoisting" this drove me nuts when I first started dabbling with Node.

    • @bondwhisperer
      @bondwhisperer 6 років тому

      Yup that's witchcraft! Thanks for pointing it out that would have been my next WTF moment I'm sure.

  • @sreeprakashneelakantan5051
    @sreeprakashneelakantan5051 5 років тому

    Thanks 🙏

    • @dabblelab
      @dabblelab  5 років тому

      You're very welcome Sreeprakash. Thanks for the comment!

  • @zo5290
    @zo5290 6 років тому

    Liked and subscribed! You are an excellent communicator and teacher! How do I format the variable if I'm calling upon an external API that renders xml? As an example, I want to pull the FullSummary from this: wsearch.nlm.nih.gov/ws/query?db=healthTopics&term=title:asthma and save the data into my response handler? Thanks again!

    • @dabblelab
      @dabblelab  6 років тому +1

      Hi Zo. Thanks for the kind feedback! On your question... You could parse the XML into a Javascript object than grab the values you need for your response. Here is a link to a node module that makes that really easy to do. www.npmjs.com/package/xml2js - I hope that helps.

    • @zo5290
      @zo5290 6 років тому

      Dabble Lab thank you!!!!! You’re the best man!

    • @dabblelab
      @dabblelab  6 років тому +1

      Happy to help!