

# ListTagsForResource
<a name="API_ListTagsForResource"></a>

Returns a list of tags associated with a resource.

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

```
GET /tags/{{ResourceArn}} HTTP/1.1
```

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

The request uses the following URI parameters.

 ** [ResourceArn](#API_ListTagsForResource_RequestSyntax) **   <a name="securityhub-ListTagsForResource-request-uri-ResourceArn"></a>
The ARN of the resource to retrieve tags for.  
Pattern: `^arn:aws:securityhub:.*`   
Required: Yes

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

The request does not have a request body.

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

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

{
   "Tags": { 
      "string" : "string" 
   }
}
```

## Response Elements
<a name="API_ListTagsForResource_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.

 ** [Tags](#API_ListTagsForResource_ResponseSyntax) **   <a name="securityhub-ListTagsForResource-response-Tags"></a>
The tags associated with a resource.  
Type: String to string map  
Map Entries: Maximum number of 50 items.  
Key Length Constraints: Minimum length of 1. Maximum length of 128.  
Key Pattern: `^(?!aws:)[a-zA-Z+-=._:/]+$`   
Value Length Constraints: Maximum length of 256.

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

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

 ** InternalException **   
Internal server error.  
HTTP Status Code: 500

 ** InvalidInputException **   
The request was rejected because you supplied an invalid or out-of-range value for an input parameter.  
HTTP Status Code: 400

 ** ResourceNotFoundException **   
The request was rejected because we can't find the specified resource.  
HTTP Status Code: 404

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

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/securityhub-2018-10-26/ListTagsForResource) 
+  [Amazon SDK for .NET V4](https://docs.amazonaws.cn/goto/DotNetSDKV4/securityhub-2018-10-26/ListTagsForResource) 
+  [Amazon SDK for C\+\+](https://docs.amazonaws.cn/goto/SdkForCpp/securityhub-2018-10-26/ListTagsForResource) 
+  [Amazon SDK for Go v2](https://docs.amazonaws.cn/goto/SdkForGoV2/securityhub-2018-10-26/ListTagsForResource) 
+  [Amazon SDK for Java V2](https://docs.amazonaws.cn/goto/SdkForJavaV2/securityhub-2018-10-26/ListTagsForResource) 
+  [Amazon SDK for JavaScript V3](https://docs.amazonaws.cn/goto/SdkForJavaScriptV3/securityhub-2018-10-26/ListTagsForResource) 
+  [Amazon SDK for Kotlin](https://docs.amazonaws.cn/goto/SdkForKotlin/securityhub-2018-10-26/ListTagsForResource) 
+  [Amazon SDK for PHP V3](https://docs.amazonaws.cn/goto/SdkForPHPV3/securityhub-2018-10-26/ListTagsForResource) 
+  [Amazon SDK for Python (Boto3)](https://docs.amazonaws.cn/goto/boto3/securityhub-2018-10-26/ListTagsForResource) 
+  [Amazon SDK for Ruby V3](https://docs.amazonaws.cn/goto/SdkForRubyV3/securityhub-2018-10-26/ListTagsForResource) 