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.
Hello, Im trying to call this API using an APP password but Im getting rejected with this error.
What can I do?
{
"type": "error",
"error": {
"message": "The requested repository either does not exist or you do not have access. If you believe this repository exists and you have access, make sure you're authenticated."
}
}
I tried multiple app password with all permissions.
Im using postman and passing my username and app password with Basic Auth as documentation suggested.
I can't use OAuth 2.0, it is even possible?
Because every other single call works.
Thank you
Hi @Manatee,
Thank you for reaching out to the community.
For us to test your app password and the API endpoint, would you be able to run the below CURL command on your local machine instead of Postman?
curl -I -u bb_username:app_password "https://api.bitbucket.org/2.0/repositories/workspace_id/repo_name/pullrequests/pr_id/diffstat"
Let's see if you're getting the 302 response according to the API endpoint documentation.
Let me know how it goes.
Regards,
Mark C
Hi, it work and I get 302 but Im not understanding what I have to do.
Because I tried using a Bearer and I get the info I was looking for, but I can't use it in my application
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Also I noticed that I was using as endpoint: bitbucket.org instead of api.bitbucket.org
OMG, this was the error. So everything fixed now :D
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
The API anyway worked using bitbucket.org/api/2.0/ but it wasn't the correct one
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I will explain which was my final goal, maybe you can help :)
We open a pull request on Bitbucket with a merge conflict.
Now assuming that we don't know that there is a merge conflict, we want to know if there is one, using API, so we tried calling the API GET pull request/id but the answer doesnt say nothing about the merge conflict warning. Now we are looking for other API but there doesnt seem to be one
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi @Manatee
You can actually extract the "location" value from the response header of the API result.
Once extracted, you can use the URL to run another API command.
curl -u bb_username:app_password "<URL here>"
The result will be in JSON format and you can find the status with the "merge conflict" value. That means the file has a merge conflict.
e.g.
"status" : "merge conflict",
Hope it helps.
Regards,
Mark C
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi @Mark C
On which API are u referring?
I tried on Postman:
GET https://api.bitbucket.org/2.0/repositories/chrmancini89/test/pullrequests/9/diffstat
GET https://api.bitbucket.org/2.0/repositories/chrmancini89/test/pullrequests/9
But none of them have some field called "location", there is only one named: "X-Dc-Location" with a value of "Micros-3".
Do you mind to be more precise about it?
Thank you for your super help
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi @Manatee
I'm not sure exactly how to do the same on Postman but I do see the "location" response header while using the CURL command below and run it on the terminal/command prompt:
curl -I -u bb_username:app_password "https://api.bitbucket.org/2.0/repositories/workspace_id/repo_name/pullrequests/pr_id/diffstat"
The URL is something like this:
location: https://api.bitbucket.org/2.0/repositories/workspace_id/repo_name/diffstat/workspace_id/repo_name:commit_hash?from_pullrequest_id=123
Regards,
Mark C
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.