GitLab
docs.gitlab.com › gitlab docs › extend › rest api
REST API | GitLab Docs
The path must start with /api/v4 (v4 represents the API version).
GitLab Docs
Learn how to use and administer GitLab, the most scalable Git-based fully integrated platform for software development.
GitLab CLI (glab)
Learn more about GitLab CLI (glab) in the GitLab documentation.
Resources
GitLab REST API resources organized by context (project, group, standalone, and templates) with endpoint paths.
Webhooks
Configure and manage project and group webhooks in GitLab.
GitLab
docs.gitlab.com › gitlab docs › extend › rest api › resources › projects
Projects API | GitLab Docs
curl --request PUT --header "PRIVATE-TOKEN: <your_access_token>" \ --data "service_desk_enabled=false" \ --url "https://gitlab.example.com/api/v4/projects/<project_id>" To find the projects in a namespace, use the list group projects endpoint with include_subgroups=true, or the list user projects endpoint for a personal namespace. Then run the previous request for each project you want to change. The service_desk_enabled field returned by the API is a computed value.
GitLab
docs.gitlab.com › gitlab docs › extend › rest api › resources
REST API resources | GitLab Docs
GitLab REST API resources organized by context (project, group, standalone, and templates) with endpoint paths.
GitLab
docs.gitlab.com › gitlab docs › extend › rest api › resources › repositories
Repositories API | GitLab Docs
curl --header "PRIVATE-TOKEN: <your_access_token>" \ --url "https://gitlab.com/api/v4/projects/<project_id>/repository/archive?sha=<commit_sha>&path=<path>&exclude_paths=<path1,path2>"
Python GitLab
python-gitlab.readthedocs.io › en › v4.12.1 › api-usage.html
Using the REST API - python-gitlab v4.12.1
gitlab.base.RESTManager is the base class for v4 objects managers, providing the API to manipulate the resources and their attributes.
GitLab
docs.gitlab.com › gitlab docs › extend › rest api › resources › users
Users API | GitLab Docs
curl --request GET \ --header "PRIVATE-TOKEN: <your_access_token>" \ --url "https://gitlab.example.com/api/v4/users/:user_id/memberships"
GitLab
docs.gitlab.com › gitlab docs › extend › rest api › resources › merge requests
Merge requests API | GitLab Docs
curl --header "PRIVATE-TOKEN: <your_access_token>" \ --url "https://gitlab.example.com/api/v4/projects/1/merge_requests/1/blocks"
Python GitLab
python-gitlab.readthedocs.io
python-gitlab v8.5.0
It includes a client for GitLab’s v4 REST API, synchronous and asynchronous GraphQL API clients, as well as a CLI tool (gitlab) wrapping REST API endpoints.
Grafana
grafana.com › docs › auth › gitlab
Configure GitLab OAuth authentication | Grafana documentation
[auth.gitlab] enabled = true allow_sign_up = true auto_login = false client_id = YOUR_GITLAB_APPLICATION_ID client_secret = YOUR_GITLAB_APPLICATION_SECRET scopes = openid email profile auth_url = https://gitlab.com/oauth/authorize token_url = https://gitlab.com/oauth/token api_url = https://gitlab.com/api/v4 role_attribute_path = contains(groups[*], 'example-group') && 'Editor' || 'Viewer' role_attribute_strict = false allow_assign_grafana_admin = false allowed_groups = ["admins", "software engineers", "developers/frontend"] allowed_domains = mycompany.com mycompany.org tls_skip_verify_insecure = false use_pkce = true use_refresh_token = true ·
GitLab
docs.gitlab.com › gitlab docs › extend › rest api › resources › branches
Branches API | GitLab Docs
February 14, 2023 - curl --request DELETE \ --header "PRIVATE-TOKEN: <your_access_token>" \ --url "https://gitlab.example.com/api/v4/projects/5/repository/branches/newbranch"
GitHub
github.com › GitLabPHP › Client
GitHub - GitLabPHP/Client: GitLab API v4 client for PHP · GitHub
GitLab - m4tthumphrey/php-gitlab-api which is this package! Check out the change log, releases, security policy, license, code of conduct, and contribution guidelines. This version supports PHP 8.1-8.5. To get started, simply require the project using Composer. You will also need to install packages that "provide" psr/http-client-implementation and psr/http-factory-implementation. $ composer require "m4tthumphrey/php-gitlab-api:^12.1" "guzzlehttp/guzzle:^7.9.2"
Author: GitLabPHP
Top answer 1 of 2
19
The documentation tell you this about how to retrieve issues from a project:
GET /projects/:id/issues
And you tried:
curl --header "PRIVATE-TOKEN: xxx" "https://gitlab.com/api/v3/projects/YYYYYY/issues"
This is correct, but the parameter you give YYYYYY has to be the project id, so it has to be an integer, not text with the project name or path. You need to use something like :
curl --header "PRIVATE-TOKEN: xxx" "https://gitlab.com/api/v3/projects/234/issues"
Where 234 is the id of your project. To get this integer id of your project, simply do a :
curl --header "PRIVATE-TOKEN: xxx" "https://gitlab.com/api/v3/projects
This will list all your projects and will give you the unique integer identifier of a project in the id field:
[
{
"id": 4, <-------- //This one
"name": "my super mega project",
"description": null,
.....
2 of 2
3
Since GitLab v11.x the /api/v3 returns error "API V3 is no longer supported. Use API V4 instead."
As of version v11 and v12, this works:
curl --header 'PRIVATE-TOKEN: mySecret' https://gitlab.com/api/v4/projects
/2/merge_requests
Parse the output (I recommend jq for that):
[
{
"id": 2, <-------------- use this number below
"name": "Duke Nukem 3D",
And then:
curl --header 'PRIVATE-TOKEN: mySecret' https://gitlab.com/api/v4/projects/2/issues
GitLab
docs.gitlab.com › gitlab docs › extend › rest api › resources › search
Search API | GitLab Docs
curl --request GET \ --header "PRIVATE-TOKEN: <your_access_token>" \ --url "https://gitlab.example.com/api/v4/search?scope=projects&search=flight"
GitLab
docs.gitlab.com › gitlab docs › extend › rest api › resources › repository files
Repository files API | GitLab Docs
curl --header "PRIVATE-TOKEN: <your_access_token>" \ --url "https://gitlab.example.com/api/v4/projects/13083/repository/files/app/models/key.rb?ref=main"
Apidog
gitlab.apidog.io
Introduction - Gitlab
When viewing this on gitlab.com, ... the current GitLab session cookie, so each request is made using your account. Instructions for using this tool can be found in Interactive API Documentation. This is the documentation for version v4 of the API....
GitLab
docs.gitlab.com › gitlab docs › extend › rest api › resources › projects › wikis
Project wikis API | GitLab Docs
Help us learn about your current experience with the documentation. Take the survey. ... Use this API to manage project wikis. An API for group wikis is also available. Comments on a wiki page are called notes. To interact with them, use the notes API. Lists all wiki pages for a specified project. ... curl --header "PRIVATE-TOKEN: <your_access_token>" \ --url "https://gitlab.example.com/api/v4/projects/1/wikis?with_content=1"
GitLab
docs.gitlab.com › gitlab docs › extend › rest api › resources › jobs
Jobs API | GitLab Docs
curl --request POST \ --header "PRIVATE-TOKEN: <your_access_token>" \ --url "https://gitlab.example.com/api/v4/projects/1/jobs/1/retry"