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

Bamboo REST API: Always fails with insufficient permissions Edited


I am attempting to use the Bamboo REST API from within Bamboo to check on the state of a previous job. However, I'm unable to get this to work.

According to the documentation for the version we are using (6.9.1), I can use the /result API -

/result/{projectKey}-{buildKey}/{buildNumber : ([0-9]+)|(latest)}

Using the script below, I'm sending a GET request to a URL similar to (where the build number changes each time) -


However, this is failing with a 401 error. The user that is authorising the REST call has admin privileges for the plan in question, so I'm not sure why this would be. I've check also to ensure that the user is active (with 0 of 3 failed captcha attempts).

You do not have sufficient read permissions

I've reviewed the documentation for using the Bamboo REST APIs, and I can see any mention of further Bamboo configuration being required to enable users to use the REST API. I have also attempted the REST call in a browser, and while I was asked to log in, the browser then receives no response at all (the network tab on F12 is empty).

My script

$bambooUrl = "https://my.bamboo.url"

### Get the state of the job that just ran the tests by using the Bamboo REST API.
$jobStateUserPassPair = "$env:bamboo_apiUsername:$env:bamboo_apiPassword"
$jobStateEncodedCreds = [System.Convert]::ToBase64String([System.Text.Encoding]::ASCII.GetBytes($jobStateUserPassPair))
$jobStateBasicAuthHeader = @{ "Authorization" = ("Basic {0}" -f $jobStateEncodedCreds) }
$jobStateUri = "{0}/rest/api/latest/result/{1}/{2}?os_authType=basic" -f $bambooUrl, $env:bamboo_buildKey, $env:bamboo_buildNumber
$jobState = Invoke-RestMethod -Method Get -Uri $jobStateUri


0 answers

Suggest an answer

Log in or Sign up to answer
Community showcase
Published in Bamboo

Bamboo Data Center - Early Access Program 2

We’re preparing for Bamboo 8.0, which will be our first Data Center release. To make sure our app vendors and customers with written in-house apps are prepared, we’re launching Bamboo 8.0 Early Acces...

75 views 0 6
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