Company
Date Published
Author
Sam Agnew
Word count
830
Language
English
Hacker News points
None

Summary

The Star Wars API is a simple REST API that can only be accessed using GET requests, allowing developers to gather data on characters such as Luke Skywalker's species or homeworld. Twilio Functions provide access to the Got library for making these HTTP requests, and are used in conjunction with the Giphy API to grab GIFs of searched characters. A Twilio Function is created by setting up a new function in the Twilio Console, inserting the necessary code, and linking it to a phone number that can receive text messages. When a user texts this number, the function executes, makes back-to-back requests to the Star Wars API, grabs a GIF from Giphy, and generates TwiML for a response message with the character's name, species, and home planet.