[英]How to get data from Secure REST API in lambda for Alexa skill?
I am creating a Alexa Skill that will get data from BPM tool. 我正在创建一个Alexa技能,该技能将从BPM工具获取数据。
My BPM Tool provide a secure rest api that we can invoke with basic auth like username and password. 我的BPM工具提供了一个安全的rest api,我们可以使用用户名和密码之类的基本身份验证来调用它。
How can i call this type of web api in node.js code created in lambda? 如何在Lambda中创建的node.js代码中调用这种类型的Web API?
Steps: 脚步:
1) Create Amazon API Gateway api for alexa and deploy into stage 1)为Alexa创建Amazon API Gateway API并部署到阶段
2) Write lambda to work with Alexa Skill 2)编写lambda以使用Alexa Skill
3) Call your API end poingt into your node.js 3)调用API结束节点到node.js
If you are worried about credentials, you can set those up as environment variables for your lambda . 如果您担心凭据,可以将其设置为lambda的环境变量 。
With that out of the way, you should be able to use any http library (like axios or needle ) to make the requests to the service. 这样一来,您应该可以使用任何http库(例如axios或needle )向服务发出请求。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.