This topic will provide you insight about how to create webhooks on AWS for your AI platforms i.e. you can post information on Amazon webhook and embed your business logic.
There is no clear blog/article that explains this integration architecture till date.
Where can this integration architecture be useful?
In AI bot flows e.g.--> Facebook (or any other front end) -- > API.AI (or any other platform ) ---> Webhook on cloud
--> Your server (can be NodeJs, or any other technology) --> Response back to API.AI (or any other platform)
Conditions : When to use this integration
- You want to use Amazon due to the high security, auto scaling capabilities.
- You do not want to use other user friendly platforms like Heroku which might not be trusted by big customers for whom you will build your AI framework.
- Tight timelines to finish the project.
- Average/less experience with AWS.
What to use to have a webhook on Amazon in simple and fast manner?
What we will use to make AWS capabilities as a webhook. Most of the forums suggest using SNS, but we won't. For some newbies the configuration etc. for the SNS might be challenging.
What we used to have a very simple, efficient and working flow is the following.
1. AWS Lambda ( to have the server less and auto scaling server logic in NodeJS or any other tech)
2. API Gateway ( to create a POST method for the Lambda function ) - This will give a URL, which we use as a webhook.
That's It.
More Insight
STEP 1 : Create the Backend for the webhook first i.e. a Lambda function.
1. Create a Lambda function, and in the template settings, set your input request content. In our case it was application/Json.
2. Set your template : This is very important. e.g. if you want to use all info in request e.g. body, header, query string etc. add the template in the template settings. This will then enable you to use methods like event.body (to get body of the http requested posted on webhook)
3. In the code you can have your business logic based on any information you want to use from the request.
STEP2 : Create the public webhook URL using API Gateway.
1. Create a POST function, and use the Lambda function created in Step 1. This will be the trigger for the Lambda function code.
2. Make sure you choose default template for pass through for the POST method (so that it passes all info to Lambda function to decide what to use).
3. Choose your permissions as needed.
4. Deploy the method, it will give you a URL - this is your webhook URL.
Hope you liked it.We work on AI projects and frameworks.
For any consultancy or more tech information. you can leave a comment.
We have working code to support all our blogs.
Thanks. Hope my research will help others.
ReplyDeleteperde modelleri
ReplyDeletesms onay
mobil ödeme bozdurma
nft nasıl alınır
Ankara evden eve nakliyat
Trafik Sigortası
dedektör
web sitesi kurma
ask romanlari
smm panel
ReplyDeleteSMM PANEL
iş ilanları
instagram takipçi satın al
Hirdavatciburada.com
beyazesyateknikservisi.com.tr
SERVİS
Jeton Hilesi