[英]Remove Messaging Webhook Programmatically from Twilio
Does anyone know of a way to remove a webhook in Twilio programmatically?有谁知道以编程方式在 Twilio 中删除 webhook 的方法?
When I use the Update
function in the Twilio library in C# and set the method, URL, and fallback URL to null, nothing changes in Twilio.当我在 C# 中使用 Twilio 库中的Update
函数并将方法、URL 和回退 URL 设置为 null 时,Twilio 中没有任何变化。 I need to be able to remove the webhook from Twilio via my program.我需要能够通过我的程序从 Twilio 中删除 webhook。
Thanks in advance!提前致谢!
IncomingPhoneNumberResource.Update(pathSid: phoneSid, smsMethod: null,
smsUrl: null,
smsFallbackUrl: null
);
I finally found the answer to my question.我终于找到了我的问题的答案。 In order to send back an empty URI for them to remove a webhook, you have to send back Twilio's EmptyUri
.为了给他们发回一个空的 URI 以删除 webhook,您必须发回 Twilio 的EmptyUri
。
var uri = new Twilio.Types.EmptyUri();
var phoneSid = "PNXXXXXXXXX";
await IncomingPhoneNumberResource.UpdateAsync(
pathSid: phoneSid,
smsUrl: uri,
smsFallbackUrl: uri
);
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.