diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2020-07-09 15:08:56 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2020-07-09 15:08:56 +0300 |
commit | fcda041fc06e7bad3e4f5b5cff921f91c7eba717 (patch) | |
tree | a7e935192b9f846fa9257daf85a1642fbaa0f01a /doc/api/project_snippets.md | |
parent | c3b45354d720654215eb0e7b8e718ba6ea2d7a96 (diff) |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'doc/api/project_snippets.md')
-rw-r--r-- | doc/api/project_snippets.md | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/doc/api/project_snippets.md b/doc/api/project_snippets.md index e5dd85fb3bb..fd8cbd6e256 100644 --- a/doc/api/project_snippets.md +++ b/doc/api/project_snippets.md @@ -183,6 +183,28 @@ curl "https://gitlab.com/api/v4/projects/:id/snippets/:snippet_id/raw" \ --header "PRIVATE-TOKEN: <your_access_token>" ``` +## Snippet repository file content + +Returns the raw file content as plain text. + +```plaintext +GET /projects/:id/snippets/:snippet_id/files/:ref/:file_path/raw +``` + +Parameters: + +- `id` (required) - The ID or [URL-encoded path of the project](README.md#namespaced-path-encoding) owned by the authenticated user +- `snippet_id` (required) - The ID of a project's snippet +- `ref` (required) - The name of a branch, tag or commit e.g. master +- `file_path` (required) - The URL-encoded path to the file, e.g. snippet%2Erb + +Example request: + +```shell +curl "https://gitlab.com/api/v4/projects/1/snippets/2/files/master/snippet%2Erb/raw" \ + --header "PRIVATE-TOKEN: <your_access_token>" +``` + ## Get user agent details > [Introduced](https://gitlab.com/gitlab-org/gitlab-foss/-/issues/29508) in GitLab 9.4. |