我與此示例代碼嘗試使用SNS的API來發送消息 -如何獲取發送至移動設備的短信回覆?
BasicAWSCredentials cr = new BasicAWSCredentials("MYACCESSKEYS","mySecretKeys");
AmazonSimpleNotificationService sns = new AmazonSimpleNotificationServiceClient(cr);
string topicArn = sns.CreateTopic(new CreateTopicRequest
{
Name = "ses-bounces-topic",
}).CreateTopicResult.TopicArn;
sns.SetTopicAttributes(new SetTopicAttributesRequest
{
TopicArn = topicArn,
AttributeName = "MyName",
AttributeValue = "Sample Notifications"
});
sns.Subscribe(new SubscribeRequest
{
TopicArn = topicArn,
Protocol = "SMS",
Endpoint = "my-mobile-number"
});
ListSubscriptionsByTopicResult ls = sns.ListSubscriptionsByTopic(new ListSubscriptionsByTopicRequest
{
TopicArn = topicArn
}).ListSubscriptionsByTopicResult;
sns.Publish(new PublishRequest {
TopicArn=topicArn,
Subject="MySms",
Message="Testing Message"
});
此代碼工作正常要發送消息給我的移動。我成功地將消息發送給支持短信的設備移動設備。
如果回覆用戶,有什麼方法可以得到回覆嗎?請指導我,如果我們可以得到使用任何API請求發回的用戶的回覆。
在此先感謝!