Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

Unable to create webhook for repository using curl command

VENKATESHWARARAO 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

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events