GitLab API

GitlabTool

Actions905

Overview

This node interacts with the GitLab API to retrieve a specific snippet by its ID using the GET method on the endpoint `/api/v4/snippets/{id}`. It is useful for scenarios where you need to fetch the details of a particular snippet stored in GitLab, such as for code review, sharing, or automation workflows involving snippet data.

Use Case Examples

  1. Fetch a snippet by its ID to display its content in a dashboard.
  2. Automate retrieval of snippet details for integration with other tools or services.

Properties

Name Meaning
Skip Authentication Determines whether to skip authentication for the API request.
Authentication Specifies the authentication method to use, defaulting to GitLab API authentication.
baseUrl The base URL of the GitLab instance to which the API request is sent.
Method The HTTP method used for the API request, defaulting to GET.
Parameter Schema Defines the path parameter 'id' which is the ID of the snippet to retrieve.
Request Body Schema Schema for the request body, not used for this GET operation.
Request Path The API endpoint path with a placeholder for the snippet ID.
Path Parameters Collection of path parameters including 'id' which specifies the snippet ID to fetch.

Output

JSON

  • id - The unique identifier of the snippet.
  • title - The title of the snippet.
  • file_name - The file name of the snippet.
  • author - Information about the author of the snippet.
  • content - The content of the snippet.
  • created_at - Timestamp when the snippet was created.
  • updated_at - Timestamp when the snippet was last updated.
  • visibility - Visibility level of the snippet (e.g., private, internal, public).

Dependencies

  • GitLab API authentication token or credentials

Troubleshooting

  • Ensure the snippet ID provided in the path parameters is valid and exists in the GitLab instance.
  • If authentication is enabled, verify that the API token or credentials are correct and have sufficient permissions to access snippets.
  • Check the base URL to ensure it points to the correct GitLab instance, especially if using a self-hosted GitLab server.
  • Common error messages include 404 Not Found if the snippet ID does not exist, and 401 Unauthorized if authentication fails.

Links

Discussion