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

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

Delete pull request from repo via API

Edited

I am trying to delete the Pull request from repo where as i am getting 405 error.

curl -vvv -s -H "Authorization: Bearer $API-TOKEN" -X DELETE "https://code.server.com/stash/rest/api/1.0/projects/~skumar/repos/test/pull-requests?$PRID" --header "Content-Type: application/json" -H "Accept: application/json"  --data '{ "version": "'"$PRVERSION"'" }'  getting error 405, (The request HTTP method is not appropriate for the targeted resource)  < allow: HEAD,POST,GET,OPTIONS.

I gave the values instead of variables. still got the same error. 

Environment: Server version 6.6.4.

as per the api-document document, I can delete, where as i am getting 405 error.  allowed methods are HEAD,POST,GET,OPTIONS. I am the owner of the repo and have admin privileges.

1 answer

1 vote

Hi Sai,

The pull request ID needs to be provided as part of the path, not as a query string - try something like this instead:

curl -vvv -s -H "Authorization: Bearer $API-TOKEN" -X DELETE "https://code.server.com/stash/rest/api/1.0/projects/~skumar/repos/test/pull-requests/$PRID" --header "Content-Type: application/json" -H "Accept: application/json"  --data '{ "version": "'"$PRVERSION"'" }'

Cheers,

Christian

Premier Support Engineer

Atlassian

Suggest an answer

Log in or Sign up to answer
TAGS
Community showcase
Published in Bitbucket

New improvements to user management in Bitbucket Cloud 👥

Hey Community! We’re willing to wager that quite a few of you not only use Bitbucket, but administer it too. Our team is excited to share that we’ll be releasing improvements throughout this month of...

3,734 views 10 16
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