GET
/
repos
/
{repo_id}
/
files
/
{ref_id}
/
{path}
curl --request GET \
  --url https://api.diversion.dev/v0/repos/{repo_id}/files/{ref_id}/{path} \
  --header 'Authorization: Bearer <token>'
{
  "path": "hello.cc",
  "prev_path": "<string>",
  "status": 1,
  "mode": 16877,
  "mtime": "2023-11-07T05:31:56Z",
  "blob": {
    "storage_uri": "repo_id/2aae6c35c94fcfb415dbe95f408b9ce91ee846ed",
    "storage_backend": 1,
    "size": 123,
    "sha": "<string>"
  }
}

Authorizations

Authorization
string
headerrequired

This API uses OAuth 2 with the implicit grant flow

Path Parameters

repo_id
string
required

The repo ID of the repository. Repo name can be used instead of the ID, but usage of ID for permanent linking and API requests is preferred.

ref_id
string
required

An ID of a workspace, branch or commit.

path
string
required

A path to a file inside the repository.

Response

200 - application/json
path
string
required
prev_path
string

Optional hint in case the item was renamed or moved

status
enum<integer>
required

One of: 1 - INTACT, 2 - ADDED, 3 - MODIFIED, 4 - DELETED

Available options:
1,
2,
3,
4
mode
enum<integer>
required

The file mode (as Unix mode)

Available options:
16877,
33188,
33261,
40960
mtime
string
blob
object