

# GetBlob
<a name="API_GetBlob"></a>

Returns the base-64 encoded content of an individual blob in a repository.

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

```
{
   "blobId": "string",
   "repositoryName": "string"
}
```

## Request Parameters
<a name="API_GetBlob_RequestParameters"></a>

For information about the parameters that are common to all actions, see [Common Parameters](CommonParameters.md).

The request accepts the following data in JSON format.

 ** [blobId](#API_GetBlob_RequestSyntax) **   <a name="CodeCommit-GetBlob-request-blobId"></a>
The ID of the blob, which is its SHA-1 pointer.  
Type: String  
Required: Yes

 ** [repositoryName](#API_GetBlob_RequestSyntax) **   <a name="CodeCommit-GetBlob-request-repositoryName"></a>
The name of the repository that contains the blob.  
Type: String  
Length Constraints: Minimum length of 1. Maximum length of 100.  
Pattern: `[\w\.-]+`   
Required: Yes

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

```
{
   "content": blob
}
```

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

 ** [content](#API_GetBlob_ResponseSyntax) **   <a name="CodeCommit-GetBlob-response-content"></a>
The content of the blob, usually a file.  
Type: Base64-encoded binary data object

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

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

 ** BlobIdDoesNotExistException **   
The specified blob does not exist.  
HTTP Status Code: 400

 ** BlobIdRequiredException **   
A blob ID is required, but was not specified.  
HTTP Status Code: 400

 ** EncryptionIntegrityChecksFailedException **   
An encryption integrity check failed.  
HTTP Status Code: 500

 ** EncryptionKeyAccessDeniedException **   
An encryption key could not be accessed.  
HTTP Status Code: 400

 ** EncryptionKeyDisabledException **   
The encryption key is disabled.  
HTTP Status Code: 400

 ** EncryptionKeyNotFoundException **   
No encryption key was found.  
HTTP Status Code: 400

 ** EncryptionKeyUnavailableException **   
The encryption key is not available.  
HTTP Status Code: 400

 ** FileTooLargeException **   
The specified file exceeds the file size limit for AWS CodeCommit. For more information about limits in AWS CodeCommit, see [Quotas](https://docs.aws.amazon.com/codecommit/latest/userguide/limits.html) in the * AWS CodeCommit User Guide*.  
HTTP Status Code: 400

 ** InvalidBlobIdException **   
The specified blob is not valid.  
HTTP Status Code: 400

 ** InvalidRepositoryNameException **   
A specified repository name is not valid.  
This exception occurs only when a specified repository name is not valid. Other exceptions occur when a required repository parameter is missing, or when a specified repository does not exist.
HTTP Status Code: 400

 ** RepositoryDoesNotExistException **   
The specified repository does not exist.  
HTTP Status Code: 400

 ** RepositoryNameRequiredException **   
A repository name is required, but was not specified.  
HTTP Status Code: 400

## See Also
<a name="API_GetBlob_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/codecommit-2015-04-13/GetBlob) 
+  [AWS SDK for .NET V4](https://docs.aws.amazon.com/goto/DotNetSDKV4/codecommit-2015-04-13/GetBlob) 
+  [AWS SDK for C\$1\$1](https://docs.aws.amazon.com/goto/SdkForCpp/codecommit-2015-04-13/GetBlob) 
+  [AWS SDK for Go v2](https://docs.aws.amazon.com/goto/SdkForGoV2/codecommit-2015-04-13/GetBlob) 
+  [AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/codecommit-2015-04-13/GetBlob) 
+  [AWS SDK for JavaScript V3](https://docs.aws.amazon.com/goto/SdkForJavaScriptV3/codecommit-2015-04-13/GetBlob) 
+  [AWS SDK for Kotlin](https://docs.aws.amazon.com/goto/SdkForKotlin/codecommit-2015-04-13/GetBlob) 
+  [AWS SDK for PHP V3](https://docs.aws.amazon.com/goto/SdkForPHPV3/codecommit-2015-04-13/GetBlob) 
+  [AWS SDK for Python](https://docs.aws.amazon.com/goto/boto3/codecommit-2015-04-13/GetBlob) 
+  [AWS SDK for Ruby V3](https://docs.aws.amazon.com/goto/SdkForRubyV3/codecommit-2015-04-13/GetBlob) 