Let’s take some baby steps; creating a pipeline status report using the GitLab API
Create a wiki-based status report on your pipelines using the GitLab API

I have been using the GitLab API for a few years, and it used to be painful. Hopefully, this article will help you get started and help you avoid some of the common pitfalls.
What is the GitLab API?
The GitLab API enables you to do all the things you can do via the web UI using the keyboard and mouse but via a REST API or GraphQL API.
When do I use the GitLab API?
I don’t think there is a generic answer to the question; most likely, you will never have to use the GitLab API because the web UI is so feature-rich. However, if you don’t want to overuse your keyboard and mouse, it helps you automate tasks and extract information from GitLab conveniently.
My journey with the GitLab API started when we wanted to create a simple dashboard that showed us the status of our software module's pipelines. At the time, we had about 15 projects, and there was no easy way to see the project's overall status of modules (without doing a lot of mouse clicking).

I initially did what most of us do; yep, I Googled it…
I found multiple promising projects. One of our favorite projects was the gitlab-ci-pipelines-exporter; it can create a dashboard like this:

It ticked most boxes and is easy to install. By installing this brilliant piece of software, we completed the task to find a dashboard, and now we could sing songs and celebrate all night long!
I need something else…
The weeks passed, and we forgot the dashboard until our friendly project manager told us:
The dashboard looks great but I need a test report for the release notes which is based on a git tag. You can skip the fancy graphics the customer only wants a simple table. Can you do Microsoft Excel?
With the new requirements in place, we quickly decided to do something inside of GitLab, i.e., not use an external tool like gitlab-ci-pipelines-exporter. Keeping everything inside of GitLab made the release process easier (but another story for another time).
Using the GitLab REST API
We decided to use the REST API, and we quickly found out that everything centers around groups and projects:
- gitlab.com/api/v4/groups
- gitlab.com/api/v4/projects
If you have a private project, you need either a Personal Access Token or a Project Access Token. If you plan to access multiple projects, the Personal Access Token is the way to go.
Let´s say that you want to look at the GitLab project in GitLab

Do you see that the Project ID is 278964? (jsonpp is a command-line JSON pretty printer)
$ curl https://gitlab.com/api/v4/projects/278964 | jsonppWould you give us the following output:







