0

So I added more than 20 badges to a gitlab project, however the web ui of badges will only list 20 badges.

I also tried to list all my badges with an api call, but again I only see 20 badges:

curl --header "PRIVATE-TOKEN: $GITLAB_API_PRIVATE_TOKEN" "https://gitlab.com/api/v4/projects/$MYPROJECTID/badges"

I noticed the same issue detailed here, but no resolution:

https://gitlab.com/gitlab-org/gitlab/-/issues/29704

How can I see and edit all of my badge id's in the ui or api?

Alex Cohen
  • 5,596
  • 16
  • 54
  • 104
  • As for the UI display, you seem to have answered your own question. The UI won't display more than 20, and it's a known issue. As for the API, you must use pagination or set the `per_page` header. Does this answer your question? [Pagination in Gitlab API only returns 100 per\_page max](https://stackoverflow.com/questions/47414024/pagination-in-gitlab-api-only-returns-100-per-page-max) – sytech Dec 16 '21 at 22:53
  • Yep thats perfect this is exactly what I needed. `curl --header "PRIVATE-TOKEN: $GITLAB_API_PRIVATE_TOKEN" "https://gitlab.com/api/v4/projects/$MYPROJECTID/badges?per_page=100&page=1" | jq .` – Alex Cohen Dec 17 '21 at 18:22

0 Answers0