Hi
Is there a good resource with examples on how to use the gitlab api?
I have read the docs but they dont really start at he beginning.
Cheers
Hi
Is there a good resource with examples on how to use the gitlab api?
I have read the docs but they dont really start at he beginning.
Cheers
It depends on what you want to accomplish, though, trying https://github.com/NARKOZ/gitlab may be a good start. Itās a ruby wrapper to access GitLab API - you can fetch data from any gitlab instances including gitlab.com and on-premises.
GitLab APIs are just REST apiās. Try googling āREST API tutorialā.
If you have any specific question, post a new question in this forum again. Be sure to specify which language and environment you are using.
FYI, REST apiās can be called from bash script using command such as curl, from language such as Java and Python.
Try entering the uri from your web browser to test the uri.
e.g. (get list of private repo)
https:///api/v3/projects/?simple=yes&private=true&per_page=2&page=1"
Next, youāll need to get authentication. The simplest way is to use private token.
https://docs.gitlab.com/ee/api/#personal-access-tokens
If you are on Linux, you can just use curl command.
curl --header "PRIVATE-TOKEN: " --insecure āhttps:///api/v3/projects/?simple=yes&private=true&per_page=2&page=1ā
You can similarly just call other apis listed in gitlab api documentation.
e.g. (to add a new user)
curl -H āPRIVATE-TOKEN: " -H āContent-Type:application/jsonā -H āAccept:application/jsonā -X POST -d '{āemailā:ā",āpasswordā:"",āusernameā:"",ānameā:""}ā https:///api/v4/users
Many thanks
GitLab API for Sub-group owners
is there any way to get a list of sub-groups and their corresponding owners through GitLab API.
Note that the list shouldnāt include āProjectsā. It should list out āsub-groupsā only.