3

I am searching for a solution to build and publish the AWS Lex bot via .NET SDK or via any other API.

Any help will be appreciated.

sepp2k
  • 363,768
  • 54
  • 674
  • 675

1 Answers1

1

I just recently developed a working Amazon Lex Chatbot using .NET SDK and one of the tools that helped a lot was the GitHub Repo that AWS maintains for C#. Do note that they use .NET core and not .NET framework.

Alternatively, if you want to use the REST API (which is what I did), you can go to the .NET documentation guide that Amazon also maintains. These REST API can be accessed via the Nuget package that you can get inside Visual Studio itself.

  • Thanks Arun for your reply, I am able to create BOT, Intents and slots via .NET SDK provided by AWS Lex, but while creating version of the bot i am getting error as "Resource 'Intent_Name' should refer to immutable versions to create new version". So to solve this issue bot needs to be build first. I did not get the api to build the same. – Chirag Solanki Sep 11 '18 at 05:43
  • Hi Chirag, the API you want in this case is the PutBot request. You can refer to this [question](https://stackoverflow.com/questions/44441662/how-do-i-build-an-amazon-lex-bot-using-the-rest-api) on StackOverflow for more details on this. Source: [Amazon Lex Documentation](https://docs.aws.amazon.com/lex/latest/dg/API_PutBot.html#lex-PutBot-request-processBehavior) – Arun Balasubramaniam Sep 12 '18 at 00:14
  • Thank you very much, i am able to build my bot now by using PUTBOT request. But how will i know if my bot throws error. – Chirag Solanki Sep 18 '18 at 06:40
  • @Chirag The response you get from Lex will contain the error (if any) instead of your response message. (For C# the field name is lexResponse.Message where lexReponse is the object that you get after posting your request to the lexService). For a list of errors, you need to refer to the [Documentation](https://docs.aws.amazon.com/lex/latest/dg/API_PutBot.html#API_PutBot_Errors). I'm not sure how you're handling errors (since you didn't post any code) so I would suggest you track the Message field from the response to see if its an error or not. – Arun Balasubramaniam Sep 19 '18 at 00:09
  • Alternatively, you can also track the HTTP status code that is returned with the response. 200 means your request was successful, any other HTTP code that appears in the [Documentation](https://docs.aws.amazon.com/lex/latest/dg/API_PutBot.html#API_PutBot_Errors) would be that specific error. – Arun Balasubramaniam Sep 19 '18 at 00:11
  • Chirag or Arun... don't think that https://github.com/aws-samples/aws-lex-net-chatbot actually creates a chatbot, it just runs an existing one as far as I can tell. I want to create and deploy a chatbot using the SDK because I need to create a new one daily based on data from a database since it has to be fairly dynamic. Can you outline your approach to the REST API with .Net? Maybe is there sample code on line? – EdwardF Dec 11 '18 at 05:24
  • @EdwardF this may help you some : [One](https://stackoverflow.com/questions/48314916/is-it-possible-to-use-amazon-lex-to-build-a-chatbot-which-connects-with-database/48336077#48336077) of my previous answers where I explained how I did it with REST API. If you need more help, please ask a new question and I can try to answer there. – Arun Balasubramaniam Dec 11 '18 at 09:17