Where Developers Build for Developers
cURL
#!/bin/bash
API_KEY="YOUR_API_KEY"
API_SECRET="YOUR_API_SECRET"
SENDER_ID="YourSenderID"
RECIPIENT="+959********"
MESSAGE="Hello, this is a test message from SMSPoh!"
API_URL="https://v3.smspoh.com/api/rest/send"
# Encode the API key and secret
CREDENTIALS=$(echo -n "$API_KEY:$API_SECRET" | base64)
# Prepare the payload
PAYLOAD=$(cat <<EOF
{
"to": "$RECIPIENT",
"message": "$MESSAGE",
"from": "$SENDER_ID"
}
EOF
)
# Send the request
curl -X POST "$API_URL" \
-H "Authorization: Bearer $CREDENTIALS" \
-H "Content-Type: application/json" \
-d "$PAYLOAD"