HOW to check id of project in gitlab

心已入冬 提交于 2020-06-26 06:23:56

问题


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!


回答1:


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]



回答2:


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.

  • See documentation,
  • see issue,
  • see merge-request.


来源:https://stackoverflow.com/questions/51349236/how-to-check-id-of-project-in-gitlab

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!