Company
Date Published
Author
Niels Swimberghe
Word count
1527
Language
English
Hacker News points
None

Summary

To build Twilio webhooks using F# and Giraffe, start by setting up your project with the necessary dependencies, including the .NET 7 SDK, Giraffe, and Twilio helper libraries. Implement the SMS and Voice webhook handlers to respond with TwiML instructions that instruct Twilio how to respond to messages or calls. Configure the webhooks on your Twilio phone number using ngrok to make your locally running application accessible to the internet. Secure your webhooks by validating HTTP requests from Twilio using the `validateTwilioRequest` HTTP handler, which checks for authentication tokens and URL overrides. With this setup, you can respond to incoming SMS and calls, and send SMS from your application using F# and Giraffe.