Supermeteor is Node Js SDK use to send SMS message and email.
How to use:
install using npm
npm install supermeteor
include supermeter in your file
const supermeteor = require('supermeteor')('SECRET_KEY');
Package uses axios for HTTP request, so for function use "async" prefix and for mathod use "await" prefix.
pass secret key, type, phone, message as function parameter, Here is the sample function call for send sms.
await supermeteor.sendMessage('sms|whatsapp','phone','message');
pass secret key, email, subject, message as function parameter, Here is the sample function call for send email.
await supermeteor.sendEmail('email','subject','message');
Inbound message hook is available in real-time, and setting is in the Setting Page.
Here are the examples of webhook data. The webhook is sent in POST method with JSON body
{
"_id": "62996851a0b5be00127052cd",
"accountId": "5ccbdc9bd7b320fe8c4e119d",
"createdAt": "2022-06-03T01:48:01.459Z",
"channel": "whatsapp",
"type": "incoming",
"status": "SUCCESS",
"phoneCountryCode": "852",
"phoneNumber": "61112222",
"fromPhoneCountryCode": "852",
"fromPhoneNumber": "64447777",
"message": "this is testing message",
"quotedMessage": null
}
{
"_id": "6299686fa0b5be00127052cf",
"accountId": "5ccbdc9bd7b320fe8c4e119d",
"createdAt": "2022-06-03T01:48:31.941Z",
"channel": "whatsapp",
"type": "incoming",
"status": "SUCCESS",
"phoneCountryCode": "852",
"phoneNumber": "61112222",
"fromPhoneCountryCode": "852",
"fromPhoneNumber": "64447777",
"image": "https://supermeteor.s3-ap-southeast-1.amazonaws.com/2022/06/6299686fa0b5be00127052cf.png"
}
{
"_id": "62996851a0b5be00127052ce",
"accountId": "5ccbdc9bd7b320fe8c4e119d",
"createdAt": "2022-06-03T01:48:01.460Z",
"channel": "whatsapp",
"type": "incoming",
"status": "SUCCESS",
"phoneCountryCode": "852",
"phoneNumber": "61112222",
"fromPhoneCountryCode": "852",
"fromPhoneNumber": "64447777",
"message": "this is quoted message",
"quotedMessage": "this is testing message"
}