Read a site's source file
Changed onReturns one file from the site's repository at ref, main by default. Text comes back as-is with encoding: utf8; content that is not valid UTF-8 (images, fonts) comes back base64-encoded with encoding: base64. Files over 4 MiB are refused with 422. A path that is not a file at ref answers 404.
ref is a branch, a tag or a commit sha; an unknown one answers 404 with param: ref. Every read reports commit_sha, the commit it read, so later reads can pass it as ref to stay on one revision, and head_sha, where main is now, to pass as expected_head_sha when you commit.
Fails with 422 repository_missing when the site has no repository yet, and 503 repository_unreachable when its repository does not answer in time (retry).
Request
- Base URLhttps://api.crevio.co/v1
- AuthAPI key in header Authorization
Path parameters
The resource's ID, as returned in its id field
Query parameters
The file, relative to the repository root (e.g. src/routes/index.tsx).
The branch, tag or commit sha to read (a sha prefix of 7 or more characters works for commits on main). Defaults to main.
Response
The file
Where main points now. Pass it as expected_head_sha when you commit.
The ref this read asked for: main unless you passed one.
The commit ref resolved to, which this answer was read at. Pass it as ref to read more of the same revision.
The file's git blob id.
Bytes.
The file's content, encoded as encoding says.
Changes
- warning
added the new
idempotency_errorenum value to theerror/typeresponse property for the response status - warning
added the new
idempotency_errorenum value to theerror/typeresponse property for the response status - warning
added the new
idempotency_errorenum value to theerror/typeresponse property for the response status
2 more changes in this revision
- warning