kulNinja
kulNinja

Reputation: 524

How to get all projects under a group called "gpt" in gitlab through API

My group has subgroups and projects. How do I retrieve all projects under "gpt" group in gitlab through API.

Upvotes: 0

Views: 73

Answers (1)

kulNinja
kulNinja

Reputation: 524

Gitlab Groups API for projects is paginated which means it gives max 100 records on 1 page. You need to check the 'X-Total-Pages' under the response header. X-Total-Pages are the total pages that you need to loop through.

resp.headers["X-Total-Pages"] should get you the total pages.

You will iterate through X-Total-Pages to get the all projects.

Upvotes: 0

Related Questions