是否可以使用 Twilio API 更改消息传递 URL 回调? [英] Is it possible to change the Messaging URL callback with the Twilio API?

查看:26
本文介绍了是否可以使用 Twilio API 更改消息传递 URL 回调?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

您好,感谢您的阅读.是否可以使用 Twilio API 更改消息传递 URL 回调?

Hello and thank you for reading. Is it possible to change the Messaging URL callback with the Twilio API?

推荐答案

您需要 POSTIncomingPhoneNumber 实例资源.

You need to POST to an IncomingPhoneNumber instance resource.

您可以使用 curl 来完成,或者如果您使用其他语言,请阅读这些文档,
https://www.twilio.com/docs/api/rest/incoming-phone-numbers?code-sample=code-update-an-incomingphonenumber&code-language=curl&code-sdk-version=json(并为示例代码选择另一种语言).

You can do it with curl, or if you're using another language read these docs,
https://www.twilio.com/docs/api/rest/incoming-phone-numbers?code-sample=code-update-an-incomingphonenumber&code-language=curl&code-sdk-version=json (and select another language for the sample code).

你需要知道:

SUB-ACCOUNT-SID \\电话号码所属账号的sid
PHONE-NUMBER-SID \\ 要更改 URL 的电话号码的 sid
MASTER-ACCOUNT-SID \\ 您的 Twilio 主帐户 sid
MASTER-ACCOUNT-TOKEN \\ 你的 Twilio 主账户令牌

SUB-ACCOUNT-SID \\ the sid for the account where the phone number belongs to
PHONE-NUMBER-SID \\ the sid of the phone number you want to change the URL
MASTER-ACCOUNT-SID \\ your Twilio master account sid
MASTER-ACCOUNT-TOKEN \\ your Twilio master account token

如果您不使用子帐户,SUB-ACCOUNT-SIDMASTER-ACCOUNT-SID 是一回事.

If you're not using sub-accounts SUB-ACCOUNT-SID and MASTER-ACCOUNT-SID are the same thing.

命令将 URL 更改为 http://demo.twilio.com/docs/sms.xml(替换为您的值):

curl -XPOST https://api.twilio.com/2010-04-01/Accounts/SUB-ACCOUNT-SID/IncomingPhoneNumbers/PHONE-NUMBER-SID.json -d "SmsUrl=http://demo.twilio.com/docs/sms.xml" -u "MASTER-ACCOUNT-SID:MASTER-ACCOUNT-TOKEN"

注意:当你替换值时,它看起来像这样

Note: when you replace the values it looks something like this

curl -XPOST https://api.twilio.com/2010-04-01/Accounts/AC0123456789abcdefabcdefabcdefabcd/IncomingPhoneNumbers/PN0123456789abcdefabcdefabcdefabcd.json -d "SmsUrl=http://demo.twilio.com/docs/sms.xml" -u "ACabcdefabcdefabcdefabcd0123456789:0123456789abcdefabcdefabcdefabcd"

这篇关于是否可以使用 Twilio API 更改消息传递 URL 回调?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆