Due to time constrains, I am not able to work on SMS Hooks at the time being. Another alternative app is Android Incoming SMS Gateway Webhook.
SMS Hooks is an app that listens for incoming SMS messages then sends a POST
request to your webhook URL containing the SMS details.
Warning: Since SMS messages can contain sensitive information, this app only allows HTTPS protocol URLs.
For each SMS message a POST request is made with a JSON body containing the SMS message and its metadata.
{
"body": "<SMS Message>",
"from": "<SMS Sender>",
"timestamp": 1598773970403, // UTC Milliseconds
}
If you have a Google account you can combine Google Sheets with Google Apps Script to create a simple webhook server that responds to the SMS webhooks and appends each SMS as a new row in the spreadsheet.
-
Create a spreadsheet in Google Sheets.
-
Create a sheet-bound Google Apps Script by selecting Extensions > Apps Script from the spreadsheet.
-
This should open the newly created Google Apps Script project. Inside the
Code.gs
file delete any existing code. -
Add the following function to the file:
/** * This function is executed when a POST request is made to the published * script URL. It appends the SMS details as a row in first sheet in the * spreadsheet bound to the script. * * For documentation about the request parameter `e` please see: * https://developers.google.com/apps-script/guides/web#request_parameters */ function doPost(e) { let sms = JSON.parse(e.postData.contents); let sheet = SpreadsheetApp.getActive().getSheets()[0]; sheet.appendRow([sms.timestamp, sms.from, sms.body]); return ContentService .createTextOutput(JSON.stringify({})) .setMimeType(ContentService.MimeType.JSON); }
-
Click the Deploy button and select New Deployment from the script.
-
For deployment type select Web App
-
Change
Who has access to the app:
to "Anyone"Warning: This means anyone with the URL can perform a POST request to this script
-
Click Deploy then complete the authorization flow.
-
Use the generated web app URL in SMS Hooks as the webhook server URL.
- Katerina Limpitsouni's unDraw for the vector illustrations