Integrating Pipe Webhooks with AWS Lambda made easy with this guide from Bobcares.
At Bobcares, we offer solutions for every query, big and small, as a part of our Server Management Service.
Let’s take a look at how our Support Team recently helped a customer with integrating Pipe Webhooks with AWS Lambda.
Integrating Pipe Webhooks with AWS Lambda
Webhooks is a useful way to integrate different software services. The recent Pipe webhook update makes it possible to send webhooks with content-type application/json. Furthermore, we can integrate them via using serverless platforms like AWS Lambda.
Lambda allows us to run code without having to create or manage actual servers. Moreover, the charges are made only for compute time, ie, when the code is running. In fact, Lambda works seamlessly with the AWS API Gateway which acts as the link between Pipe webhooks and AWS Lambda.
How to setup Lambda
- First, we will head to the AWS Console and search for Lambda in order to get to the Lambda dashboard.
- Next, select Create Function from the dashboard.
- Then, click Author from Scratch option as seen below:
- After that, we have to select a function name and any runtime we prefer.
After this process, the new Lambda function is up and ready. All we have to do is write the code via the inline code editor. If we require additional packages or modules, we can zip them along with the specific modules or packages and upload them to Lambda.
For instance, here is the basic handler code. It parses the Pipe webhook Data and returns a response:
exports.handler = async (event) => { let webhookData = JSON.parse(event.body); const response = { statusCode: 200, body: webhookData.data.videoName }; return response; };
How to plug in the API Gateway
- First, we have to search for the API Gateway in the AWS Console.
- Next, we have to select Create API in the API Gateway.
- Then, we will choose REST API.
- After that, we will come across another setup screen. Here, we have to note down the Endpoint Type. Then we will choose a name for the API and click Create API.
- After creating the API, we have to create a method for API. For instance, we can create a POST method. We can do this by going to the Actions section under API Resources and selecting Create Method.
- Next, we have to make the new method a POST method by clicking the checkmark next to it.
- Now, we will see the POST setup details. We have to select Integration type as the Lambda Function. Furthermore, we have to check Use Lambda Proxy Integration.
This helps redirect the endpoint to the Lambda function we made in the earlier section. You will notice that the form automatically detects the Lambda function name. Remember to click Save after setting it up.
- Then, we have to complete the AWS setup by deploying the API to a stage. We can do this by selecting Deploy API from Actions.
- Finally, we will click Deploy.
This process will generate an invoke URL. We can use this with the Pipe webhook.
How to plug in the Pipe Webhook
- First, we will click Add New Webhook in the Pipe webhooks dashboard.
- Then, we have to input the API Gateway Invoke URL for the Webhook URL.
- Next, we have to select the events for which we want a notification.
- After that, we have to ensure the content type is application/json so that the integration will work.
- Finally, we will click Save webhook.
Our Support Techs recommend running a quick test with the help of the Pipe webhook simulator to ensure everything is working:
- We have to input the API Gateway Invoke URL for the Webhook URL.
- Then, we will select application/json as the Content type.
- Next, we have to modify the POSTed data and click Send Data.
- We will receive the test data in the Response tab.
[Wondering how to solve another query? We are just a click away.]
Conclusion
To conclude, the skilled Support Engineers at Bobcares demonstrated how to integrate Pipe Webhooks with AWS Lambda.
PREVENT YOUR SERVER FROM CRASHING!
Never again lose customers to poor server speed! Let us help you.
Our server experts will monitor & maintain your server 24/7 so that it remains lightning fast and secure.
0 Comments