

# GetChannel

Gets the current state of a table's channel in Amazon S3 Tables.

The operation returns the following information about the channel:
+ The state of the channel
+ The approximate number of rows that the channel has buffered and not yet committed to the table
+ An error code and a message that describe the error, if an error blocks commits

The default channel is created the first time that `PutRows` writes to the table. Until then, `GetChannel` fails with a `NotFoundException` error.

Permissions  
To use this operation, you must have the `s3tables:GetChannel` permission on the table.

## Request Syntax
<a name="API_s3Buckets_GetChannel_RequestSyntax"></a>

```
GET /tables/channel?channelId={{channelId}}&tableArn={{tableARN}} HTTP/1.1
```

## URI Request Parameters
<a name="API_s3Buckets_GetChannel_RequestParameters"></a>

The request uses the following URI parameters.

 ** [channelId](#API_s3Buckets_GetChannel_RequestSyntax) **   <a name="AmazonS3-s3Buckets_GetChannel-request-uri-channelId"></a>
The identifier of the channel whose state you want to get. If you don't specify a channel, the operation uses `default`. Only `default` is supported.  
Length Constraints: Minimum length of 1. Maximum length of 64.  
Pattern: `[a-z0-9-]+` 

 ** [tableARN](#API_s3Buckets_GetChannel_RequestSyntax) **   <a name="AmazonS3-s3Buckets_GetChannel-request-uri-tableARN"></a>
The Amazon Resource Name (ARN) of the table that the channel belongs to.  
Length Constraints: Minimum length of 1. Maximum length of 2048.  
Pattern: `(arn:aws[-a-z0-9]*:[a-z0-9]+:[-a-z0-9]*:[0-9]{12}:bucket/[a-z0-9_-]{3,63}/table/[a-zA-Z0-9-_]{1,255})`   
Required: Yes

## Request Body
<a name="API_s3Buckets_GetChannel_RequestBody"></a>

The request does not have a request body.

## Response Syntax
<a name="API_s3Buckets_GetChannel_ResponseSyntax"></a>

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

{
   "approximateNumberOfBufferedRows": number,
   "errorCode": "string",
   "errorMessage": "string",
   "state": "string"
}
```

## Response Elements
<a name="API_s3Buckets_GetChannel_ResponseElements"></a>

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

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

 ** [approximateNumberOfBufferedRows](#API_s3Buckets_GetChannel_ResponseSyntax) **   <a name="AmazonS3-s3Buckets_GetChannel-response-approximateNumberOfBufferedRows"></a>
The approximate number of rows that the channel has buffered and not yet committed to the table.  
Type: Long

 ** [errorCode](#API_s3Buckets_GetChannel_ResponseSyntax) **   <a name="AmazonS3-s3Buckets_GetChannel-response-errorCode"></a>
The code of the error that's blocking the channel from committing buffered rows to the table. For how to fix each error, see `ChannelErrorCode`. `GetChannel` returns this value only when `state` is `failing`.  
Type: String  
Valid Values: `kms_key_disabled | kms_access_denied | kms_key_not_found` 

 ** [errorMessage](#API_s3Buckets_GetChannel_ResponseSyntax) **   <a name="AmazonS3-s3Buckets_GetChannel-response-errorMessage"></a>
A message that describes the error in `errorCode`. `GetChannel` returns this value only together with `errorCode`.  
Type: String

 ** [state](#API_s3Buckets_GetChannel_ResponseSyntax) **   <a name="AmazonS3-s3Buckets_GetChannel-response-state"></a>
The current state of the channel. The state is one of the following values:  
+  `active` – The channel is operating normally.
+  `failing` – The channel can't commit rows to the table because of an error that requires your action. For details, see `errorCode` and `errorMessage`.
Type: String  
Valid Values: `active | failing` 

## Errors
<a name="API_s3Buckets_GetChannel_Errors"></a>

 ** AccessDeniedException **   
The action cannot be performed because you do not have the required permission.  
HTTP Status Code: 403

 ** BadRequestException **   
The request is invalid or malformed.  
HTTP Status Code: 400

 ** ForbiddenException **   
The caller isn't authorized to make the request.  
HTTP Status Code: 403

 ** InternalServerErrorException **   
The request failed due to an internal server error.  
HTTP Status Code: 500

 ** NotFoundException **   
The request was rejected because the specified resource could not be found.  
HTTP Status Code: 404

 ** TooManyRequestsException **   
The limit on the number of requests per second was exceeded.  
HTTP Status Code: 429

## See Also
<a name="API_s3Buckets_GetChannel_SeeAlso"></a>

For more information about using this API in one of the language-specific AWS SDKs, see the following:
+  [AWS Command Line Interface V2](https://docs.aws.amazon.com/goto/cli2/s3tables-2018-05-10/GetChannel) 
+  [AWS SDK for .NET V4](https://docs.aws.amazon.com/goto/DotNetSDKV4/s3tables-2018-05-10/GetChannel) 
+  [AWS SDK for C\+\+](https://docs.aws.amazon.com/goto/SdkForCpp/s3tables-2018-05-10/GetChannel) 
+  [AWS SDK for Go v2](https://docs.aws.amazon.com/goto/SdkForGoV2/s3tables-2018-05-10/GetChannel) 
+  [AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/s3tables-2018-05-10/GetChannel) 
+  [AWS SDK for JavaScript V3](https://docs.aws.amazon.com/goto/SdkForJavaScriptV3/s3tables-2018-05-10/GetChannel) 
+  [AWS SDK for Kotlin](https://docs.aws.amazon.com/goto/SdkForKotlin/s3tables-2018-05-10/GetChannel) 
+  [AWS SDK for PHP V3](https://docs.aws.amazon.com/goto/SdkForPHPV3/s3tables-2018-05-10/GetChannel) 
+  [AWS SDK for Python (Boto3)](https://docs.aws.amazon.com/goto/boto3/s3tables-2018-05-10/GetChannel) 
+  [AWS SDK for Ruby V3](https://docs.aws.amazon.com/goto/SdkForRubyV3/s3tables-2018-05-10/GetChannel) 