You're on your way to the next level! Join the Kudos program to earn points and save your progress.
Level 1: Seed
25 / 150 points
Next: Root
1 badge earned
Challenges come and go, but your rewards stay with you. Do more to earn more!
What goes around comes around! Share the love by gifting kudos to your peers.
Keep earning points to reach the top of the leaderboard. It resets every quarter so you always have a chance!
Join now to unlock these features and more
The Atlassian Community can help you and your team get more value out of Atlassian products and practices.
Hi
I created a project on bitbucket and created a pull request.
https://bitbucket.org/<my_pseudo>/<my_repo>/pull-requests/1/
I create an app-password
Now I would like to retrieve pull request information with "curl" and REST API.
I try
curl -v -u <my_login>:<my_app_password> https://api.bitbucket.org/2.0/repositories/test/pull-requests
No response but verbose says that:
* Trying 18.205.93.8:443...
* Connected to api.bitbucket.org (18.205.93.8) port 443 (#0)
* schannel: disabled automatic use of client certificate
* schannel: ALPN, offering http/1.1
* schannel: ALPN, server accepted to use http/1.1
* Server auth using Basic with user '<my_login>'
> GET /2.0/repositories/test/pull-requests HTTP/1.1
> Host: api.bitbucket.org
> Authorization: Basic b2xpdmllci5hcHBlcmU6SlV5OFljQzdhUzVTRm1QcXhQN1k=
> User-Agent: curl/7.79.1
> Accept: */*
>
* Mark bundle as not supporting multiuse
< HTTP/1.1 401 Unauthorized
< Server: nginx
< Vary: Origin
* Authentication problem. Ignoring this.
< WWW-Authenticate: Basic realm="Bitbucket.org HTTP"
< Content-Type: text/plain
< X-B3-TraceId: a0259912425ae7e4
< X-Usage-Output-Ops: 0
< X-Dc-Location: Micros
< Strict-Transport-Security: max-age=31536000; includeSubDomains; preload
< Date: Sun, 24 Apr 2022 09:41:27 GMT
< X-Usage-User-Time: 0.009101
< X-Usage-System-Time: 0.004353
< X-Served-By: 13ec9c009674
< ETag: "d41d8cd98f00b204e9800998ecf8427e"
< X-Static-Version: 9c0ba0615ff1
< X-Render-Time: 0.0149459838867
< Connection: keep-alive
< X-Usage-Input-Ops: 0
< X-Version: 9c0ba0615ff1
< X-Request-Count: 2147
< X-Frame-Options: SAMEORIGIN
< Content-Length: 0
<
* Connection #0 to host api.bitbucket.org left intact
I search here https://developer.atlassian.com/cloud/bitbucket/rest/intro/ but I miss a tutorial for absolute beginner
Thanks
Olivier
Hello @extralucide
Welcome to Atlassian Community!
You may use this API to get PR details
Sample CURL call as below:
curl -X GET -u username:AppPassword "https://api.bitbucket.org/2.0/repositories/workspaceID/repo_slug/pullrequests/1"
Kindly replace with the workspace ID, repo slug & PR number.
I hope this helps.
Kind regards,
Karthick S
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.