Get Contents at Specific Repository Path
GET/api/v5/repos/:owner/:repo/contents/:path
Request
Path Parameters
owner stringrequired
Repository space address (organization or individual's address path)
repo stringrequired
Repository path (path)
path stringrequired
The path of the file.
Query Parameters
access_token string
User authorization code
ref string
Branch, tag, or commit. Defaults to the repository's default branch (main).
Responses
- 200
Successful Response
Response Headers
- application/json
- Schema
- Example (auto)
- Example
Schema
typestring
encodingstring
sizeinteger
namestring
pathstring
contentstring
shastring
urlstring
html_urlstring
download_urlstring
_links object
selfstring
htmlstring
{
"type": "string",
"encoding": "string",
"size": 0,
"name": "string",
"path": "string",
"content": "string",
"sha": "string",
"url": "string",
"html_url": "string",
"download_url": "string",
"_links": {
"self": "string",
"html": "string"
}
}
{
"type": "file",
"encoding": "base64",
"size": 19,
"name": "Note2.md",
"path": "Note2.md",
"content": "JXU2RDRCJXU4QkQ1d2ViaG9vaw==",
"sha": "e5699fe1b360d6c799ee58b24fb5a670b1e14851",
"url": "https://gitcode.com/api/v5/repos/daming_1/zhu_di/contents/Note2.md",
"html_url": "https://gitcode.com/daming_1/zhu_di/blob/master/Note2.md",
"download_url": "https://gitcode.com/daming_1/zhu_di/raw/master/Note2.md",
"_links": {
"self": "https://gitcode.com/api/v5/repos/daming_1/zhu_di/contents/Note2.md",
"html": "https://gitcode.com/daming_1/zhu_di/blob/master/Note2.md"
}
}