WotsApp Bash Script
Script to send WA
Script
#!/bin/bash
token=$1
session_id=$2
number=$3
text=$4
if [ $# -lt 1 ]; then
echo "Please provide the token as an argument"
exit 1
fi
if [ $# -lt 2 ]; then
echo "Please provide session_id as an argument"
exit 1
fi
if [ $# -lt 3 ]; then
echo "Please provide number as an argument"
exit 1
fi
if [ $# -lt 4 ]; then
echo "Please provide text as an argument"
exit 1
fi
curl --location 'https://wa.uripsub.dev/api/messages/send' \
--header "Authorization: Bearer ${token}" \
--header 'Content-Type: application/json' \
--data "{\"sessionId\": \"${session_id}\", \"number\": \"${number}\", \"text\": \"${text}\", \"imageUrl\": null}"
How to Use
# example :
scriptUrl.sh token123 akun-1 6287722171171 'test kirim wa'