简体   繁体   中英

sending customParams in Twilio SMS node js

I am sending SMS to users using Twilio SMS service, in nodejs. I am using twilio npm package .

I want to send customParams while sending the sms and get those params in webhook response when it gets delivere, so that I can update my database.

For example, something like this:

customParams: {
   userId: <userid>
}

Here is my code to create the sms:

twilioClient.messages.create({
    to: USER_PHONE,
    body: smsBody,
    messagingServiceSid: MSG_SERVICE_ID,
}).then(resp => {
    console.log('SMS sent', resp)
})

Please let me know how can we possibly send sms with custom parameters.

使用自定义查询参数设置 statusCallback URL。

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM