翻訳は機械翻訳により提供されています。提供された翻訳内容と英語版の間で齟齬、不一致または矛盾がある場合、英語版が優先します。
AWS SDK または CLI GetIdentityVerificationAttributes
で を使用する
以下のコード例は、GetIdentityVerificationAttributes
の使用方法を示しています。
アクション例は、より大きなプログラムからのコードの抜粋であり、コンテキスト内で実行する必要があります。次のコード例で、このアクションのコンテキストを確認できます。
- .NET
-
- AWS SDK for .NET
-
注記
については、「」を参照してください GitHub。AWS コード例リポジトリ
で全く同じ例を見つけて、設定と実行の方法を確認してください。 /// <summary> /// Get identity verification status for an email. /// </summary> /// <returns>The verification status of the email.</returns> public async Task<VerificationStatus> GetIdentityStatusAsync(string email) { var result = VerificationStatus.TemporaryFailure; try { var response = await _amazonSimpleEmailService.GetIdentityVerificationAttributesAsync( new GetIdentityVerificationAttributesRequest { Identities = new List<string> { email } }); if (response.VerificationAttributes.ContainsKey(email)) result = response.VerificationAttributes[email].VerificationStatus; } catch (Exception ex) { Console.WriteLine("GetIdentityStatusAsync failed with exception: " + ex.Message); } return result; }
-
API の詳細については、「 API リファレンスGetIdentityVerificationAttributes」の「」を参照してください。 AWS SDK for .NET
-
- CLI
-
- AWS CLI
-
ID リストの Amazon SES 検証ステータスを取得するには
次の例では、
get-identity-verification-attributes
コマンドを使用して ID リストの Amazon SES 検証ステータスを取得します。aws ses get-identity-verification-attributes --identities
"user1@example.com"
"user2@example.com"
出力:
{ "VerificationAttributes": { "user1@example.com": { "VerificationStatus": "Success" }, "user2@example.com": { "VerificationStatus": "Pending" } } }
検証のために、送信したことがない ID を使用してこのコマンドを呼び出した場合、その ID は出力に表示されません。
検証済み ID の詳細については、「Amazon Simple Email Service デベロッパーガイド」の「Amazon SES での E メールアドレスとドメインの検証」を参照してください。
-
API の詳細については、「 コマンドリファレンスGetIdentityVerificationAttributes
」の「」を参照してください。 AWS CLI
-
- Python
-
- SDK for Python (Boto3)
-
注記
については、「」を参照してください GitHub。AWS コード例リポジトリ
で全く同じ例を見つけて、設定と実行の方法を確認してください。 class SesIdentity: """Encapsulates Amazon SES identity functions.""" def __init__(self, ses_client): """ :param ses_client: A Boto3 Amazon SES client. """ self.ses_client = ses_client def get_identity_status(self, identity): """ Gets the status of an identity. This can be used to discover whether an identity has been successfully verified. :param identity: The identity to query. :return: The status of the identity. """ try: response = self.ses_client.get_identity_verification_attributes( Identities=[identity] ) status = response["VerificationAttributes"].get( identity, {"VerificationStatus": "NotFound"} )["VerificationStatus"] logger.info("Got status of %s for %s.", status, identity) except ClientError: logger.exception("Couldn't get status for %s.", identity) raise else: return status
-
API の詳細については、 GetIdentityVerificationAttributes AWS SDK for Python (Boto3) API リファレンスの「」を参照してください。
-
- Ruby
-
- SDK for Ruby
-
注記
については、「」を参照してください GitHub。AWS コード例リポジトリ
で全く同じ例を見つけて、設定と実行の方法を確認してください。 require "aws-sdk-ses" # v2: require 'aws-sdk' # Create client in us-west-2 region # Replace us-west-2 with the AWS Region you're using for Amazon SES. client = Aws::SES::Client.new(region: "us-west-2") # Get up to 1000 identities ids = client.list_identities({ identity_type: "EmailAddress" }) ids.identities.each do |email| attrs = client.get_identity_verification_attributes({ identities: [email] }) status = attrs.verification_attributes[email].verification_status # Display email addresses that have been verified if status == "Success" puts email end end
-
API の詳細については、「 API リファレンスGetIdentityVerificationAttributes」の「」を参照してください。 AWS SDK for Ruby
-
AWS SDK デベロッパーガイドとコード例の完全なリストについては、「」を参照してくださいAWS SDK での Amazon SES の使用。このトピックには、使用開始方法に関する情報と、以前の SDK バージョンの詳細も含まれています。