The script above will configure your Google Sheet to handle a GET request (function doGet()), tells the spreadsheet where to place the received data (lines 21–38), and sets the allowed MIME type (setMimeType(ContentService.MimeType.JSON)). Give it a read—Will Patera did a great job explaining the script with his comments so I left them in there. (The original gist can be found here.)
Save the script and give it an appropriate name. Then go to the “Run” menu and select “setup.”
You might be asked to give Google Scripts to use your Google account.
Once you’ve given your authorization, go to the “Publish” menu and select “Deploy as web app.”
You will then be presented with a few options with which to customize your script.