API | Get file from repository without Project ID

How Can I use the API to get a file from a repository without the Project ID?

  • In the API documentation I see that you can get a file from a repository if you have a project ID. Is there a way to get a file if you just have groups, sub-groups, and a project name and file path?

  • I am using Gitlab 13.7 EE, but I am interested in answers for any newer versions of EE as well.

  • Currently I am trying scripts to map and determine of the ID of all projects. If there is an easy way to do this even when there are sub-groups, let me know.

Hi @bobbaxter

You could search for a project by name for example:

https://gitlab.com/api/v4/projects?search=triage-ops

Or maybe iterate over the projects belonging to a group.

HTH,

Sarah