简体   繁体   English

在 Twilio SMS 节点 js 中发送 customParams

[英]sending customParams in Twilio SMS node js

I am sending SMS to users using Twilio SMS service, in nodejs.我在 nodejs 中使用 Twilio SMS 服务向用户发送 SMS。 I am using twilio npm package .我正在使用twilio npm 包

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.我想在发送短信时发送 customParams 并在交付时在 webhook 响应中获取这些参数,以便我可以更新我的数据库。

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。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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