The pandemic isnâ€™t over yet; it seems like a long night before the dawn. After all the ups and downs, the virus is continuing to affect people, communities, and businesses around the world. Although we are finally recovering from it, the situation is still unpredictable even after the arrival of the vaccine.
If you live in the US, you may have heard of COVID-19 tracking projects that provide up-to-date data related to the number of tests, positive cases, and deaths. Interesting; isnâ€™t it? Let’s dive deep into this writing piece with an experienced Twilio developer and find out how to develop a Twilio-powered app to track COVID-19 cases:
1. Create Your Twilio Account
First, create a free Twilio trial account and then get a phone number by the location or area code. Once you have the number, find the â€˜Twilio Studioâ€™ option in the left sidebar and then click â€˜Create a Flowâ€™. Enter any name for the flow and select â€˜Start from Scratchâ€™ on the template selection screen.
2. Create Your Studio Flow
You might see aâ€˜Widget Libraryâ€™ on the right, scroll down to the Messaging segment, and click-and-drag â€˜Send Messageâ€™ onto the canvas. Also, enter ‘Send Reply’ and ‘Hello, Twilio’ for the message body. Drag and place the dot from â€˜Incoming Messageâ€™ to the ‘Send Reply’ widget. Donâ€™t forget to click the â€˜Publishâ€™button in the end.
3. Run the Studio Flow
Now send your number a text message and see whether you get a preconfigured reply from Twilio. To confirm, scroll to the bottom and choose â€˜Studio Flowâ€™ in the â€˜Messagingâ€™ section. Then choose the name of the â€˜Studio Flowâ€™ youâ€™ve created and save it at the bottom.Â
4. Develop a Server-Less Function
Open the â€˜Twilio Functionsâ€™ section and select the â€˜Create a Functionâ€™ button. Choose and create the â€˜JSON Responseâ€™ template. Enter a path for the function and check the â€˜Access Controlâ€™ box so that only the function runs when it is called by another Twilio service.
5. Add the Function to the Studio Flow
Created a function? Itâ€™s time to add it to the Studio flow. Open the â€˜Studio Flowâ€™ and scroll down to the â€˜Tools and Execute Codeâ€™ segment. Click-and-drag â€˜Run Functionâ€™ and then click on that function widget. Update the name and select the function in the drop-down. Make sure itâ€™s working when you send a text to your Twilio number.
6. Complete the Data Function
Finally, itâ€™s time to update the Twilio function. When the API request is correct, we will get the COVID-19 information from the response data object. Click â€˜Configureâ€™ on the left side, scroll down to the â€˜Dependenciesâ€™ section, and click the red/white + button. Finally, click â€˜Saveâ€™ so that your function will be re-deployed.
Have you made it this far? Congratulations, you’ve successfully developed a COVID-19 tracking app with a Twilio developer. You see, developing such apps is relatively easy with Twilio Studio and Twilio Functions. If you need any need with your project, ask the experts at our Twilio development company today.