It's not the same without you

Join the community to find out what other Atlassian users are discussing, debating and creating.

Atlassian Community Hero Image Collage

Post Webhook REST API Edited

Ji Yong Park Feb 19, 2018

Hello,

I am trying to use the "Post Webhooks for Bitbucket" add-on/plugin for my project and was wondering if there is a way to configure webhooks via REST api.

Currently, I am implementing a specific service to detect repo being created and seed the configurations including the post webhook. This endpoint listed in the documentation did not work for me: http://example.com/rest/api/1.0/projects/{projectKey}/repos/{repositorySlug}/webhooks.

Edit: I realized that the doc I was looking at was for the latest release of the server. I am using v4.9.1, which doesn't seem to have the endpoint. Is there no other way to make this work on this version? Also, is this the correct endpoint to achieve my goal here?

 

Thank you!

 

2 answers

0 votes
Richard Vodden Feb 28, 2018 • edited

  

0 votes
Anderson Norberto Santos Dec 13, 2018 • edited

I'm currently using Bitbucket v4.12.1 and these endpoints works for me:

GET: /rest/webhook/1.0/projects/{projectKey}/repos/{repositorySlug}/configurations

to get existing webhook data of a particular repository. The response is similar to this:

[
{
"id": 123,
"title": "Webhook's title",
"url": "https://your.server/webhook",
"committersToIgnore": "",
"branchesToIgnore": "",
"enabled": true
}
]

PUT: /rest/webhook/1.0/projects/{projectKey}/repos/{repositorySlug}/configurations

to create a webhook. The request body should be similar to this:

 {
"title": "Webhook's title",
"url": "https://your.server/webhook",
"committersToIgnore": "",
"branchesToIgnore": "",
"enabled": true
}

 

DELETE: /rest/webhook/1.0/projects/{projectKey}/repos/{repositorySlug}/configurations/{ID}

to remove an existing webhook.

 

I hope helped you!

Suggest an answer

Log in or Sign up to answer
This widget could not be displayed.
This widget could not be displayed.
Community showcase
Published in Bitbucket Pipelines

Building a Bitbucket Pipe as a casual coder

...ipe.sh :  #!/bin/bash source "$(dirname "$0")/common.sh" enable_debug extra_args="" if [[ "${DEBUG}" == "true" ]]; then extra_args="--verbose" fi # mandatory variables R...

1,883 views 1 19
Read article

Community Events

Connect with like-minded Atlassian users at free events near you!

Find an event

Connect with like-minded Atlassian users at free events near you!

Unfortunately there are no Community Events near you at the moment.

Host an event

You're one step closer to meeting fellow Atlassian users at your local event. Learn more about Community Events

Events near you