GitLab API

GitlabTool

Actions1000

Overview

This node operation retrieves snippets from a specific project in GitLab using the GitLab API. It is useful for scenarios where users want to access or manage code snippets associated with a particular project, such as for code sharing, documentation, or collaboration within a project.

Use Case Examples

  1. Fetching all snippets from a project to display in a dashboard.
  2. Retrieving snippets for backup or migration purposes.
  3. Listing snippets to analyze or audit project-related code snippets.

Properties

Name Meaning
Skip Authentication Option to skip authentication for the request, useful for public projects or testing.
Authentication Type of authentication used, defaulting to GitLab API key authentication.
baseUrl Base URL of the GitLab instance, default is https://gitlab.com.
Method HTTP method to use for the request, default is GET.
Query Parameters Optional query parameters to control pagination such as page number and items per page.
Path Parameters Path parameters including the project ID or URL-encoded path to specify which project's snippets to retrieve.

Output

JSON

  • id - Unique identifier of the snippet
  • title - Title of the snippet
  • file_name - Filename of the snippet
  • description - Description of the snippet
  • visibility - Visibility level of the snippet (e.g., private, internal, public)
  • author
    • id - ID of the author who created the snippet
    • name - Name of the author
    • username - Username of the author
  • created_at - Timestamp when the snippet was created
  • updated_at - Timestamp when the snippet was last updated
  • web_url - URL to access the snippet on GitLab

Dependencies

  • GitLab API key credential

Troubleshooting

  • Ensure the project ID or URL-encoded path is correct to avoid 404 errors.
  • Check authentication credentials if access is denied or unauthorized errors occur.
  • Verify the base URL is correct for self-hosted GitLab instances.
  • Pagination parameters should be valid integers; otherwise, the API may return errors or unexpected results.

Links

Discussion