summaryrefslogtreecommitdiff
path: root/doc/api/snippets.md
diff options
context:
space:
mode:
authorGitLab Bot <gitlab-bot@gitlab.com>2020-07-20 12:26:25 +0000
committerGitLab Bot <gitlab-bot@gitlab.com>2020-07-20 12:26:25 +0000
commita09983ae35713f5a2bbb100981116d31ce99826e (patch)
tree2ee2af7bd104d57086db360a7e6d8c9d5d43667a /doc/api/snippets.md
parent18c5ab32b738c0b6ecb4d0df3994000482f34bd8 (diff)
downloadgitlab-ce-a09983ae35713f5a2bbb100981116d31ce99826e.tar.gz
Add latest changes from gitlab-org/gitlab@13-2-stable-ee
Diffstat (limited to 'doc/api/snippets.md')
-rw-r--r--doc/api/snippets.md28
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.