0

With Gitlab API it is currently possible to get a specific page of the wiki, and to edit it.

With UI, when you click on a page, you can view its history and see various truncated commit hash depending on version. Is it possible to get these hash with API? Can't find anything in documentation.

Thanks!

Ticoincoin
  • 157
  • 1
  • 2
  • 15

2 Answers2

1

Wiki API is there to access the wiki at its current state. Other than that you can use Projects API to see wiki events:

https GET "https://gitlab.url/api/v4/projects/123456/events?target_type=wiki" "PRIVATE-TOKEN: your_private_token"

where gitlab.url is your GitLab instance URL, 123456 is the project ID and your_private_token is your private token

  • Thanks! This is useful information, even if not really what I need. From this I get an id, which I guess is an event id. But it is not related to version_id of wiki page so. – Ticoincoin Apr 26 '22 at 10:03
0

It's not possible using API. The solution I used was to use the fact that the wiki is a git repo. So I cloned the wiki repo and got last relevant commit ID with git log -n1 --format="%H" My-page.md

Ticoincoin
  • 157
  • 1
  • 2
  • 15