GitLab API

GitlabTool

Actions1095

Snippets → getApiV4SnippetsIdFilesRefFilePathRaw

AI-generated

Summary

Retrieves the raw contents of a file from a GitLab snippet for a specified branch, tag, or commit. Set the snippet ID, ref, and URL-encoded file path; the request uses GET by default and the GitLab API credential unless authentication is skipped.

Inputs

  • Skip Authentication — Defaults to false; enable to skip GitLab API authentication.
  • Base URL — Defaults to https://gitlab.com. The node source says the actual base URL is defined in the GitLab API credential.
  • Method — HTTP method; defaults to GET.
  • File_path (required) — URL-encoded path to the file, such as lib%2Fclass%2Erb.
  • Ref (required) — Branch, tag, or commit name.
  • Id (required) — Snippet ID.

Output shape

Raw file contents returned by the GitLab API.

The endpoint is /api/v4/snippets/{id}/files/{ref}/{file_path}/raw. The source pack does not show how the base URL, request method, or response body is handled at runtime; the output may therefore depend on the API response and the shared OpenAPI tool implementation.

Examples

Example 1: Request a file's raw contents from a GitLab snippet.

Use the default GET method and GitLab authentication. Set Id to the snippet ID, Ref to a branch, tag, or commit, and File_path to the URL-encoded file path (for example, lib%2Fclass%2Erb). The base URL defaults to https://gitlab.com; the node source indicates the GitLab API credential supplies the actual base URL.

Links

Discussion