-1

I am an intern working on a chatbot with AWS Lex. I want to be able to tell the bot to "select a file", then "give me the name on the file".

Our company has a REST api containing these files. How would be able to do this?

I cant even get lex to fetch data from any API.

If anyone could guide me in the right direction, even fetching data from any public REST APIs, that would help alot! Thank you

Here is the lambda code that returns "Hello from lambda!" inside the chat window.

exports.handler = (event, context, callback) => {

    callback(null, {
      "dialogAction": {
        "type": "Close",
        "fulfillmentState": "Fulfilled",
        "message": {
            "contentType": "PlainText",
             "content": "Hello from lambda!"
        }

      }

    });
}; 
Reza
  • 73
  • 1
  • 8
  • So you want to know how to build your own API? – Reez0 Jun 10 '19 at 18:18
  • You need to give a whole lot more detail. accessing an API is as simple as making a web request using any of the many available http libs. API gateway is for making your lambda function reachable via simple web request. – bryan60 Jun 10 '19 at 18:33
  • You don't really "connect to an API". Rather, some code makes a call to an API, which then returns a response. What do you mean by "our companies internal API"? What does it do? Feel free to edit your question to provide more details. – John Rotenstein Jun 10 '19 at 22:35
  • @JohnRotenstein edited the question hopefully explained more clearly now! – Reza Jun 12 '19 at 17:15
  • @bryan60 edited the question hopefully explained more clearly now! – Reza Jun 12 '19 at 17:23
  • not really... you say you can't get Lex to call an API but lex doesn't call API's, it's a chatbot service... lambda can call an API, so why don't you post what you've tried on that front. – bryan60 Jun 12 '19 at 20:10