1

「検証済みドメイン名」のリストに新しいドメイン名を追加し、DNS を更新して、ドメイン名が aws によって検証済みとしてマークされているかどうかを API (実際には PHP SDK) を介して検証したいと考えています。これまでのところ、私はこれを持っています

function get_verified_status($domain, $key, $secret) {
// Instantiate the client with your AWS credentials
        $ses = SesClient::factory(array(
                    'key'     => $key,
                    'secret'  => $secret,
                    'region'  => Region::US_EAST_1
                ));
print_r($domain);
echo "response";
$response = $ses->GetIdentityVerificationAttributes($domain);
#$response = $ses->list_verified_email_addresses();

//get_identity_verification_attributes
        return $response;
}

応答は( cli から実行)

php test.php

Array
(
    [0] => appi.com
    [1] => acs.com
)
responsePHP Fatal error:  Uncaught exception 'Guzzle\Service\Exception\ValidationException' with message 'Validation errors: [Identities] is a required array: A list of identities.' in /var/www/html/s3/vendor/guzzle/guzzle/src/Guzzle/Service/Command/AbstractCommand.php:376
Stack trace:
#0 /var/www/html/s3/vendor/guzzle/guzzle/src/Guzzle/Service/Command/AbstractCommand.php(272): Guzzle\Service\Command\AbstractCommand->validate()
#1 /var/www/html/s3/vendor/guzzle/guzzle/src/Guzzle/Service/Client.php(193): Guzzle\Service\Command\AbstractCommand->prepare()
#2 /var/www/html/s3/vendor/guzzle/guzzle/src/Guzzle/Service/Command/AbstractCommand.php(162): Guzzle\Service\Client->execute(Object(Aws\Common\Command\QueryCommand))
#3 /var/www/html/s3/vendor/guzzle/guzzle/src/Guzzle/Service/Command/AbstractCommand.php(213): Guzzle\Service\Command\AbstractCommand->execute()
#4 /var/www/html/s3/vendor/guzzle/guzzle/src/Guzzle/Service/Client.php(93): Guzzle\Service\Command\AbstractCommand->getResult()
#5 /var/www/html/s3/vendo in /var/www/html/s3/vendor/guzzle/guzzle/src/Guzzle/Service/Command/AbstractCommand.php on line 376

印刷物に見られるように配列を渡すため、このエラーが発生する理由がわかりません。私は本当にあなたの助けに感謝します

4

1 に答える 1

2

GetIdentityVerificationAttributes の AWS SDK for PHP API ドキュメントによると、入力パラメータの構造により、次のようにメソッドを呼び出す必要があります。

$result = $ses->getIdentityVerificationAttributes(array(
    'Identities' => $domains
));

print_r($result->toArray());

それが役立つことを願っています!

于 2013-06-11T18:57:05.877 に答える