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

Earn badges and make progress

You're on your way to the next level! Join the Kudos program to earn points and save your progress.

Deleted user Avatar
Deleted user

Level 1: Seed

25 / 150 points

Next: Root

Avatar

1 badge earned

Collect

Participate in fun challenges

Challenges come and go, but your rewards stay with you. Do more to earn more!

Challenges
Coins

Gift kudos to your peers

What goes around comes around! Share the love by gifting kudos to your peers.

Recognition
Ribbon

Rise up in the ranks

Keep earning points to reach the top of the leaderboard. It resets every quarter so you always have a chance!

Leaderboard

Come for the products,
stay for the community

The Atlassian Community can help you and your team get more value out of Atlassian products and practices.

Atlassian Community about banner
4,463,709
Community Members
 
Community Events
176
Community Groups

REST API Authentication problem

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

1 answer

0 votes
Karthick S Atlassian Team Apr 25, 2022

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

Suggest an answer

Log in or Sign up to answer
TAGS

Atlassian Community Events