Skip to content

Instantly share code, notes, and snippets.

@adeisbright
Created January 17, 2025 08:26
Show Gist options
  • Save adeisbright/dc6bc5b7317c587e094b692cbd482d6f to your computer and use it in GitHub Desktop.
Save adeisbright/dc6bc5b7317c587e094b692cbd482d6f to your computer and use it in GitHub Desktop.
An example on how to use termii for delivering sms
const sendTokenWithTermii = async (message) => {
const data = {
"api_key" : Config.termiiToken,
"message_type" : "NUMERIC",
"to" : "+2348140850141",
"from" : "Bigjara",
"channel" : "dnd",
"pin_attempts" : 10,
"pin_time_to_live" : 5,
"pin_length" : 4,
"pin_placeholder" : "< 1234 >",
"message_text" :message,
"pin_type" : "NUMERIC"
};
return await axios({
url : "https://api.ng.termii.com/api/sms/otp/send" ,
method : "post" ,
headers : {
Accept : "application/json"
} ,
data
})
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment