The Atlassian Community Forums are currently in read-only mode. We will be relaunching on a new platform on September 22 (read more here). We apologize for the extended downtime. For concerns or questions, please email communitymanagers@atlassian.com. See you on the other side, on the new Atlassian Community Forums! :)

×

Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

Unable to create webhook for repository using curl command

VENKATESHWARARAO
Contributor
June 12, 2020

We are needing to add a webhook from Bitbucket to AWS api(for integration with CDK, CodeBuilt, CodeDeploy, etc)and the only way to add webhooks at this time is to enter each repository, settings, webhooks and input the url manually through the UI. we have probably 100 repositories, so that's a lot . So I have written script it seems strong i can do it via series of curl commands .But when i am trying to execute curl command it returns 

HTTP Status 405 – Method Not Allowed

The method received in the request-line is known by the origin server but not supported by the target resource.

I have tried the following curl commands.

curl -u "$myuser:$mypass" -H "Content-Type: application/json" -X PUT -d '{"title":"Title name", "url": "https://url.amazonaws.com/prod/", "enabled": "true"}' http://bitbucket.company.com:7990/plugins/servlet/webhooks/projects/Myproject/repos/Myreponame/configurations 

curl -u "$myuser:$mypass" -H "Content-Type: application/json" -X PUT -d '{"title":"Title name", "url": "https://url.amazonaws.com/prod/", "enabled": "true"}' http://bitbucket.company.com:7990/rest/webhook/1.0/projects/MyProject/repos/MyReponame/configurations

 

Thanks in advance.

0 answers

Comments for this post are closed

Community moderators have prevented the ability to post new answers.

TAGS
AUG Leaders

Atlassian Community Events