Reputation: 75955
I can see that it is possible to add a git hook to Bitbucket in the interface like so:
Is it possible to add a POST
hook like this using Bitbucket's API instead of using the web interface? Is it possible to remove an existing hook using the API?
Upvotes: 1
Views: 1373
Reputation: 5726
services resource might help you.
curl -u tutorials:8798987 -X POST https://api.bitbucket.org/1.0/repositories/tutorials/testrepo/services/ -d "type=POST&URL=https%3A%2F%2Fbitbucket.org/post"
This will create a new POST hook with https://bitbucket.org/post
as URL:
{
"id": 5,
"service": {
"fields": [
{
"name": "URL",
"value": "https://bitbucket.org/post"
}
],
"type": "POST"
}
}
Upvotes: 5