

本文為英文版的機器翻譯版本，如內容有任何歧義或不一致之處，概以英文版為準。

# GetPrimaryEmail
<a name="API_GetPrimaryEmail"></a>

擷取指定帳戶的主要電子郵件地址。

## 請求語法
<a name="API_GetPrimaryEmail_RequestSyntax"></a>

```
POST /getPrimaryEmail HTTP/1.1
Content-type: application/json

{
   "AccountId": "string"
}
```

## URI 請求參數
<a name="API_GetPrimaryEmail_RequestParameters"></a>

請求不會使用任何 URI 參數。

## 請求主體
<a name="API_GetPrimaryEmail_RequestBody"></a>

請求接受採用 JSON 格式的下列資料。

 ** [AccountId](#API_GetPrimaryEmail_RequestSyntax) **   <a name="accounts-GetPrimaryEmail-request-AccountId"></a>
指定您要透過此操作存取或修改之 AWS 帳戶 的 12 位數帳戶 ID 號碼。若要使用此參數，發起人必須是[組織管理帳戶](https://docs.aws.amazon.com/organizations/latest/userguide/orgs_getting-started_concepts.html#account)或委派管理員帳戶中的身分。指定的帳戶 ID 必須是相同組織中的成員帳戶。組織必須[啟用所有功能](https://docs.aws.amazon.com/organizations/latest/userguide/orgs_manage_org_support-all-features.html)，且組織必須針對帳戶管理服務啟用[受信任存取](https://docs.aws.amazon.com/organizations/latest/userguide/orgs_integrate_services.html)，並選擇性地指派[委派的管理員](https://docs.aws.amazon.com/organizations/latest/userguide/orgs_getting-started_concepts.html#delegated-admin)帳戶。  
此操作只能從成員帳戶的管理帳戶或組織的委派管理員帳戶呼叫。  
管理帳戶無法指定自己的 `AccountId`。
類型：字串  
模式：`\d{12}`  
必要：是

## 回應語法
<a name="API_GetPrimaryEmail_ResponseSyntax"></a>

```
HTTP/1.1 200
Content-type: application/json

{
   "PrimaryEmail": "string"
}
```

## 回應元素
<a name="API_GetPrimaryEmail_ResponseElements"></a>

如果動作成功，則服務傳回 HTTP 200 回應。

服務會傳回下列 JSON 格式的資料。

 ** [PrimaryEmail](#API_GetPrimaryEmail_ResponseSyntax) **   <a name="accounts-GetPrimaryEmail-response-PrimaryEmail"></a>
擷取與指定帳戶相關聯的主要電子郵件地址。  
類型：字串  
長度限制：長度下限為 5。長度上限為 64。

## 錯誤
<a name="API_GetPrimaryEmail_Errors"></a>

如需所有動作常見錯誤的資訊，請參閱[常見錯誤類型](CommonErrors.md)。

 ** AccessDeniedException **   
操作失敗，因為呼叫身分沒有所需的最低許可。    
 ** errorType **   
由 API Gateway 填入`x-amzn-ErrorType`回應標頭的值。
HTTP 狀態碼：403

 ** InternalServerException **   
由於 內部發生錯誤，操作失敗 AWS。請稍後重試您的操作。    
 ** errorType **   
由 API Gateway 填入`x-amzn-ErrorType`回應標頭的值。
HTTP 狀態碼：500

 ** ResourceNotFoundException **   
操作失敗，因為它指定了找不到的資源。    
 ** errorType **   
由 API Gateway 填入`x-amzn-ErrorType`回應標頭的值。
HTTP 狀態碼：404

 ** TooManyRequestsException **   
操作失敗，因為呼叫次數太頻繁且超過節流限制。    
 ** errorType **   
由 API Gateway 填入`x-amzn-ErrorType`回應標頭的值。
HTTP 狀態碼：429

 ** ValidationException **   
操作失敗，因為其中一個輸入參數無效。    
 ** fieldList **   
偵測到無效項目的欄位。  
 ** message **   
通知您有關請求無效內容的訊息。  
 ** reason **   
驗證失敗的原因。
HTTP 狀態碼：400

## 另請參閱
<a name="API_GetPrimaryEmail_SeeAlso"></a>

如需在其中一種語言特定 AWS SDKs中使用此 API 的詳細資訊，請參閱下列內容：
+  [AWS 命令列界面 V2](https://docs.aws.amazon.com/goto/cli2/account-2021-02-01/GetPrimaryEmail) 
+  [AWS 適用於 .NET V4 的 SDK](https://docs.aws.amazon.com/goto/DotNetSDKV4/account-2021-02-01/GetPrimaryEmail) 
+  [AWS 適用於 C\$1\$1 的 SDK](https://docs.aws.amazon.com/goto/SdkForCpp/account-2021-02-01/GetPrimaryEmail) 
+  [AWS 適用於 Go 的 SDK v2](https://docs.aws.amazon.com/goto/SdkForGoV2/account-2021-02-01/GetPrimaryEmail) 
+  [AWS 適用於 Java V2 的 SDK](https://docs.aws.amazon.com/goto/SdkForJavaV2/account-2021-02-01/GetPrimaryEmail) 
+  [AWS 適用於 JavaScript V3 的 SDK](https://docs.aws.amazon.com/goto/SdkForJavaScriptV3/account-2021-02-01/GetPrimaryEmail) 
+  [AWS 適用於 Kotlin 的 SDK](https://docs.aws.amazon.com/goto/SdkForKotlin/account-2021-02-01/GetPrimaryEmail) 
+  [AWS 適用於 PHP V3 的 SDK](https://docs.aws.amazon.com/goto/SdkForPHPV3/account-2021-02-01/GetPrimaryEmail) 
+  [AWS 適用於 Python 的 SDK](https://docs.aws.amazon.com/goto/boto3/account-2021-02-01/GetPrimaryEmail) 
+  [AWS 適用於 Ruby V3 的 SDK](https://docs.aws.amazon.com/goto/SdkForRubyV3/account-2021-02-01/GetPrimaryEmail) 