相关疑难解决方法(0)

AWS SNS 参数电话号码无效

我正在尝试学习 aws sns 服务以从我的 Web 应用程序发送短信。我正在本地主机上工作。

$params = array(
    'credentials' => array(
        'key' => 'iam_key',
        'secret' => 'iam_secret',
    ),
    'region' => 'ap-south-1', // < your aws from SNS Topic region
    'version' => 'latest',
    'http' => ['verify'=>false]
);
$sns = \Aws\Sns\SnsClient::factory($params);

$msgattributes = [
        'AWS.SNS.SMS.SenderID' => [
            'DataType' => 'String',
            'StringValue' => 'Klassroom',
        ],
        'AWS.SNS.SMS.SMSType' => [
            'DataType' => 'String',
            'StringValue' => 'Transactional',
        ]
    ];

$payload = array(
        'Message' => "HK test",
        "PhoneNumber" => "1234567890",
        'MessageAttributes' => $msgattributes
    );

$result = …
Run Code Online (Sandbox Code Playgroud)

php amazon-web-services amazon-sns web

5
推荐指数
1
解决办法
1471
查看次数

标签 统计

amazon-sns ×1

amazon-web-services ×1

php ×1

web ×1