Gitalb api
Jump to navigation
Jump to search
Basic API Calls for Gitlab
curl -L "https://gitlab.iwillfearnoevil.com/api/v4/projects" | jq '.' Partial return: { "id": 17, "description": "Find out all the things when invoked", "name": "discovery", "name_with_namespace": "monitoring / discovery", "path": "discovery", "path_with_namespace": "monitoring/discovery", "created_at": "2016-06-18T21:35:07.253Z", "default_branch": "master", "tag_list": [], "topics": [], "ssh_url_to_repo": "git@gitlab01.iwillfearnoevil.com:monitoring/discovery.git", "http_url_to_repo": "https://gitlab01.iwillfearnoevil.com/monitoring/discovery.git", "web_url": "https://gitlab01.iwillfearnoevil.com/monitoring/discovery", "readme_url": null, "avatar_url": null, "forks_count": 0, "star_count": 0, "last_activity_at": "2016-06-18T21:57:23.124Z", "namespace": { "id": 4, "name": "monitoring", "path": "monitoring", "kind": "group", "full_path": "monitoring", "parent_id": null, "avatar_url": null, "web_url": "https://gitlab01.iwillfearnoevil.com/groups/monitoring" } }
Working Example
This is using an APPLICATION PAT, not a user PAT. Issues seem to arise with user PAT. Likely issue with missed setting int GUI.
curl -s -q --request GET --header "PRIVATE-TOKEN: glpat-t5_6CE7Xz3sN1Kby_65H" -L "https://gitlab.iwillfearnoevil.com/api/v4/notification_settings" | jq '.' { "level": "participating", "notification_email": "project56_bot@noreply.gitlab01.iwillfearnoevil.com" }