

# GetSinkPolicy


Returns the current sink policy attached to this sink. The sink policy specifies what accounts can attach to this sink as source accounts, and what types of data they can share.

## Request Syntax


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

{
   "SinkIdentifier": "string"
}
```

## URI Request Parameters


The request does not use any URI parameters.

## Request Body


The request accepts the following data in JSON format.

 ** [SinkIdentifier](#API_GetSinkPolicy_RequestSyntax) **   <a name="OAM-GetSinkPolicy-request-SinkIdentifier"></a>
The ARN of the sink to retrieve the policy of.  
Type: String  
Pattern: `[a-zA-Z0-9][a-zA-Z0-9_:\.\-\/]{0,2047}`   
Required: Yes

## Response Syntax


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

{
   "Policy": "string",
   "SinkArn": "string",
   "SinkId": "string"
}
```

## Response Elements


If the action is successful, the service sends back an HTTP 200 response.

The following data is returned in JSON format by the service.

 ** [Policy](#API_GetSinkPolicy_ResponseSyntax) **   <a name="OAM-GetSinkPolicy-response-Policy"></a>
The policy that you specified, in JSON format.  
Type: String

 ** [SinkArn](#API_GetSinkPolicy_ResponseSyntax) **   <a name="OAM-GetSinkPolicy-response-SinkArn"></a>
The ARN of the sink.  
Type: String

 ** [SinkId](#API_GetSinkPolicy_ResponseSyntax) **   <a name="OAM-GetSinkPolicy-response-SinkId"></a>
The random ID string that Amazon generated as part of the sink ARN.  
Type: String

## Errors


For information about the errors that are common to all actions, see [Common Error Types](CommonErrors.md).

 ** InternalServiceFault **   
Unexpected error while processing the request. Retry the request.    
 ** amznErrorType **   
The name of the exception.
HTTP Status Code: 500

 ** InvalidParameterException **   
A parameter is specified incorrectly.    
 ** amznErrorType **   
The name of the exception.
HTTP Status Code: 400

 ** MissingRequiredParameterException **   
A required parameter is missing from the request.    
 ** amznErrorType **   
The name of the exception.
HTTP Status Code: 400

 ** ResourceNotFoundException **   
The request references a resource that does not exist.    
 ** amznErrorType **   
The name of the exception.
HTTP Status Code: 404

## See Also


For more information about using this API in one of the language-specific Amazon SDKs, see the following:
+  [Amazon Command Line Interface V2](https://docs.amazonaws.cn/goto/cli2/oam-2022-06-10/GetSinkPolicy) 
+  [Amazon SDK for .NET V4](https://docs.amazonaws.cn/goto/DotNetSDKV4/oam-2022-06-10/GetSinkPolicy) 
+  [Amazon SDK for C\$1\$1](https://docs.amazonaws.cn/goto/SdkForCpp/oam-2022-06-10/GetSinkPolicy) 
+  [Amazon SDK for Go v2](https://docs.amazonaws.cn/goto/SdkForGoV2/oam-2022-06-10/GetSinkPolicy) 
+  [Amazon SDK for Java V2](https://docs.amazonaws.cn/goto/SdkForJavaV2/oam-2022-06-10/GetSinkPolicy) 
+  [Amazon SDK for JavaScript V3](https://docs.amazonaws.cn/goto/SdkForJavaScriptV3/oam-2022-06-10/GetSinkPolicy) 
+  [Amazon SDK for Kotlin](https://docs.amazonaws.cn/goto/SdkForKotlin/oam-2022-06-10/GetSinkPolicy) 
+  [Amazon SDK for PHP V3](https://docs.amazonaws.cn/goto/SdkForPHPV3/oam-2022-06-10/GetSinkPolicy) 
+  [Amazon SDK for Python](https://docs.amazonaws.cn/goto/boto3/oam-2022-06-10/GetSinkPolicy) 
+  [Amazon SDK for Ruby V3](https://docs.amazonaws.cn/goto/SdkForRubyV3/oam-2022-06-10/GetSinkPolicy) 