user10084314
user10084314

Reputation: 31

HOW to check id of project in gitlab

I want to use GitLab API to get the contents of my project. The URL is like this:

https://gitlab.com/api/v4/projects/:id/repository/files/:file_path?private-token=xxxxx

I have already created the private token, but I can not find my project's ID.

Looking for reply!

Upvotes: 3

Views: 7919

Answers (2)

VonC
VonC

Reputation: 1329292

Since GitLab 11.2 (August 22nd, 2018), it is easier to check out one's project ID, thanks to Tuğçe Nur Taş.

See "Show project ID on project overview":

GitLab projects are associated with an auto-generated, unique project ID upon creation. This information is available in the General project settings and via our API.

With this release, we have added the project ID to the project overview page, so that users without Maintainer permissions also have access to this ID when needed.

https://about.gitlab.com/images/11_2/project-id-on-overview.png

Upvotes: 3

Steve Mulvihill
Steve Mulvihill

Reputation: 717

You can use the following to get the project's ID, inserting the project path which should be URL encoded.

Example:

https://gitlab.com/api/v4/projects/[project path URL encoded]

Upvotes: 1

Related Questions