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/snippets.md | |
parent | c3b45354d720654215eb0e7b8e718ba6ea2d7a96 (diff) |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'doc/api/snippets.md')
-rw-r--r-- | doc/api/snippets.md | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/doc/api/snippets.md b/doc/api/snippets.md index 1aa3eecfd29..db94716c2d4 100644 --- a/doc/api/snippets.md +++ b/doc/api/snippets.md @@ -150,6 +150,34 @@ Example response: Hello World snippet ``` +## Snippet repository file content + +Returns the raw file content as plain text. + +```plaintext +GET /snippets/:id/files/:ref/:file_path/raw +``` + +Parameters: + +| Attribute | Type | Required | Description | +|:------------|:--------|:---------|:-------------------------------------------------------------------| +| `id` | integer | yes | ID of snippet to retrieve | +| `ref` | string | yes | Reference to a tag, branch or commit | +| `file_path` | string | yes | URL-encoded path to the file | + +Example request: + +```shell +curl --header "PRIVATE-TOKEN: <your_access_token>" "https://gitlab.example.com/api/v4/snippets/1/files/master/snippet%2Erb/raw" +``` + +Example response: + +```plaintext +Hello World snippet +``` + ## Create new snippet Create a new snippet. |