v1

latestOpenAPI 3.0.0Apache 2.0 License2026-07-1477523442.5 KB

Returns the base-64 encoded contents of a specified file and its metadata.

post/#X-Amz-Target=CodeCommit_20150413.GetFile

Headers

X-Amz-Target'CodeCommit_20150413.GetFile' required

Request body

repositoryNamestring required

The name of the repository that contains the file.

commitSpecifierstring

The fully quaified reference that identifies the commit that contains the file. For example, you can specify a full commit ID, a tag, a branch name, or a reference such as refs/heads/master. If none is provided, the head commit is used.

filePathstring required

The fully qualified path to the file, including the full name and extension of the file. For example, /examples/file.md is the fully qualified path to a file named file.md in a folder named examples.

Response

Success

commitIdstring required

The full commit ID of the commit that contains the content returned by GetFile.

blobIdstring required

The blob ID of the object that represents the file content.

filePathstring required

The fully qualified path to the specified file. Returns the name and extension of the file.

fileMode'EXECUTABLE' | 'NORMAL' | 'SYMLINK' required
<p>The extrapolated file mode permissions of the blob. Valid values include strings such as EXECUTABLE and not numeric values.</p> <note> <p>The file mode permissions returned by this API are not the standard file mode permission values, such as 100644, but rather extrapolated values. See the supported return values.</p> </note>
fileSizeinteger required

The size of the contents of the file, in bytes.

fileContentstring required

The base-64 encoded binary data object that represents the content of the file.