我与此示例代码尝试使用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请求发回的用户的回复。
在此先感谢!