This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from flask import Flask, request, jsonify, Response | |
import requests | |
from requests.auth import HTTPBasicAuth | |
import os | |
app = Flask(__name__) | |
# Recommended for production: Use environment variables for credentials | |
# SMS_API_USERNAME = os.environ.get('SMS_API_USERNAME') | |
# SMS_API_PASSWORD = os.environ.get('SMS_API_PASSWORD') |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import json | |
import requests | |
def lambda_handler(event, context): | |
# Extract query parameters from the event | |
params = event.get('queryStringParameters', {}) | |
# Check for required parameters | |
required_params = ['username', 'password', 'to', 'message'] | |
missing_params = [param for param in required_params if param not in params] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const express = require('express'); | |
const axios = require('axios'); | |
const bodyParser = require('body-parser'); | |
const app = express(); | |
// Middleware for parsing JSON bodies | |
app.use(bodyParser.json()); | |
// Configuration from environment variables |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// Set the log file path | |
$logFile = 'sms_webhook_log.txt'; | |
// Get the raw POST data | |
$rawData = file_get_contents('php://input'); | |
// Decode the JSON data | |
$data = json_decode($rawData, true); |