Text "bestsellers" to +12155156567 to get the top 15 books on the NYT bestselling hardcover list using the NYT Books API, Twilio Functions, and the Twilio Serverless Toolkit.
You will need an API key for the NYT API! Follow the directions here to get one.
JS code is in functions/blank.js
. To run the code, you will need to install the Twilio Serverless Toolkit.
npm install twilio-cli -g
twilio login
twilio plugins:install @twilio-labs/plugin-serverless
Install the lone requirement
npm install superagent
In the root directory, deploy the Twilio Serverless app with
twilio serverless:deploy
Grab the URL ending with /blank
and configure a Twilio phone number with it so you can text the number and get a response back! Otherwise, you can hit the NYT API URL in Postman to get some data back.