Is there any way of creating webhooks in GitLab via API similiar to what we have in GitHub using GitHub API by Koshuke?
2 Answers
You can add, list, edit and delete webhooks.
POST /projects/:id/hooks
You can add a webhook with your project ID or with namespace/project_name
Take a look at this http://doc.gitlab.com/ce/api/projects.html#add-project-hook
Comments
There only seem to be an API (for listing/creating or deleting hooks) for:
- system hooks, not webhooks.
System hooks were introduced in March 2013 for GitLab 5.0. - project hooks (documented here)
3 Comments
Technext
Any idea how can i get the variable name which contains JSON result sent from GitLab when any project is created? The plugin above is for webhook as asked by OP. I am looking for system hook where i can run a Jenkins job by fetching JSON data sent from GitLab.
VonC
@Technext that is a good question which deserves a spot of its own for all contributors to answer to instead of being buried in the comments.
Technext
Thanks for the comment. There is already a question posted for my query: stackoverflow.com/questions/25568936/…