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

401 error when access on repos with bitbucket-build-statistics pipeline

Will Chan November 8, 2022

Hi we want to use the bitbucket-build-statistics pipeline to monitor our repos 

but it did not work  ✖ 401 Client Error: Unauthorized for url: https://api.bitbucket.org/2.0/repositories/{workspace}?pagelen=100&fields=next,values.full_name

I am wondering if this is because we do not have the admin right to use the api in this workspace? 

Been trying to use my Username and App password.

Thank you. 

 

2 answers

0 votes
Igor Stoyanov
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
November 10, 2022

@Will Chan hi. You can check your authorization process locally with simple python script:

import requests
import json


def api_call():
response = requests.get(
url,
auth=(username, password)
)

print(json.loads(response.text))


if __name__ == '__main__':
api_call()

username is the name from https://bitbucket.org/account/settings/ Username

password is your generated app password from https://bitbucket.org/account/settings/app-passwords/.

Regards, Igor

0 votes
henkjan krijger November 8, 2022

The workspace name should match the username used to access to access the repository. causing only a search of repository with the username to be successful, but attempts to save the repository returned 404 error my website longest snap streak is same error I fixed it the same way.

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
CLOUD
PERMISSIONS LEVEL
Site Admin
TAGS
AUG Leaders

Atlassian Community Events