[英]Authenticate Azure Email Communication Services using Service Principals in Python
[英]Azure Communication Services Simple SMS
ACS 新手,我只想发送一条 SMS 消息。 官方 MS 示例不起作用。 我收到 401 未经授权的错误。 我试过像示例一样使用连接字符串构建客户端,我试过使用 DefaultAzureCredential。 朝那个方向前进会导致未知错误。 有没有人有任何建议如何让 ACS SMS SendAsync 调用工作或让我知道我做错了什么?
确保将<from-phone-number>
设置为您之前使用电话号码功能sms:PhoneNumberCapabilityType.Outbound
注册的电话号码。
var capabilities = new PhoneNumberCapabilities(sms:PhoneNumberCapabilityType.Outbound);
// ... register the phone number and use it in the following code:
SmsSendResult sendResult = smsClient.Send(
from: "<from-phone-number>",
to: "<to-phone-number>",
message: "Hello World via SMS"
);
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.