Get Even More Visitors To Your Blog, Upgrade To A Business Listing >>

Send WhatsApp Messages With Vonage And Appwrite Functions

Posted on Sep 8 As a part of Appwrite 1.4, one of the new features we have introduced to Appwrite Functions is Function Templates. Function templates are pre-built Appwrite Functions that can be integrated into your Appwrite project with just a few clicks. Using them, you can easily incorporate new features and integrations into your app without writing additional code or managing infrastructure.One such integration you can implement using Appwrite Functions is WhatsApp messaging via Vonage. In this blog, you will learn how you can use an Appwrite Function Template to create a Whatsapp bot that will programmatically respond to incoming WhatsApp messages via Vonage.The first step is to create a Vonage account. Head over to Vonage’s website and sign up to use Vonage Communication APIs. On the Vonage API Dashboard, visit the API Settings tab and copy the API Key, API Secret, and Signature Secret from there.After that, visit the Messages API Sandbox and enable WhatsApp to set up a test environment for our Appwrite Function template. Make sure to copy the Phone Number provided there (and join the WhatsApp channel with the instructions on the page. Once the Appwrite Function is deployed, we will return here to add the Function URL as the Inbound Webhook link.Now that we have all the necessary details from our Vonage account, let us get the function ready on Appwrite. Head over to your Appwrite project and visit the Functions page. From there, we will select the Templates tab, search for and select the WhatsApp with Vonage function template.This function requires 4 environment variables to setup:After you have configured the environment variables, you must connect your Appwrite account with GitHub, select Create a new repository (this will generate a GitHub repository for you with the function), and leave the production branch and root settings as default to create this function.Once the function is ready, visit the Domains tab on the function page and copy the domain to add to the Inbound Webhook link on the Messages API Sandbox page on your Vonage account.Once all the aforementioned steps are complete, it is time to test the function!Open the WhatsApp app on your phone, join the Vonage WhatsApp Channel (via the steps mentioned on the Messaging API Sandbox on Vonage), and send any message to the WhatsApp number. You shall receive a message in the format: Hi there! You sent me: We’ve covered the basics, and now it’s your time to shine! With a few changes, you should be able to extend this template to fit your app. Be sure to check out the other available Function Templates. We’ve created many that could be of use in your projects. You can find the templates GitHub repository here.For more information about Appwrite and Appwrite Functions:Templates let you quickly answer FAQs or store snippets for re-use. Are you sure you want to hide this comment? It will become hidden in your post, but will still be visible via the comment's permalink. Hide child comments as well Confirm For further actions, you may consider blocking this person and/or reporting abuse Pradumna Saraf - Aug 6 Dany Paredes - Aug 4 Nikita Koselev - Aug 14 Alessandro Pischedda - Aug 14 Once suspended, appwrite will not be able to comment or publish posts until their suspension is removed. Once unsuspended, appwrite will be able to comment and publish posts again. Once unpublished, all posts by appwrite will become hidden and only accessible to themselves. If appwrite is not suspended, they can still re-publish their posts from their dashboard. Note: Once unpublished, this post will become invisible to the public and only accessible to Aditya Oberai. They can still re-publish the post if they are not suspended. Thanks for keeping DEV Community safe. Here is what you can do to flag appwrite: appwrite consistently posts content that violates DEV Community's code of conduct because it is harassing, offensive or spammy. Unflagging appwrite will restore default visibility to their posts. DEV Community — A constructive and inclusive social network for software developers. With you every step of your journey. Built on Forem — the open source software that powers DEV and other inclusive communities.Made with love and Ruby on Rails. DEV Community © 2016 - 2023. We're a place where coders share, stay up-to-date and grow their careers.



This post first appeared on VedVyas Articles, please read the originial post: here

Share the post

Send WhatsApp Messages With Vonage And Appwrite Functions

×

Subscribe to Vedvyas Articles

Get updates delivered right to your inbox!

Thank you for your subscription

×