I'm attempting to use the API to script repo creation, but I'm getting a 401 authorization error. I'm using basic HTTP authentication, with my username and a personal access token. I'm in the "administrators" group, which has Admin access to the project, and I specified Admin access for my personal access token. I'm using this URL:
https://<our server address>/rest/api/1.0/projects/EP/repos
I'm making a POST request with the Content-Type "application/json" and the body (though I tried with all 3 documented parameters and it didn't make a difference):
{
"name": "TestRepo"
}I'm in BitBucket Server 5.15.0, and the GET request to the same URL using my Personal Access Token returns the list of projects. Also, using my regular password works as expected. This is the response I'm getting for the POST request authenticating with my token:
HTTP/1.1 401
Server: nginx/1.14.0
Date: Wed, 17 Apr 2019 22:24:00 GMT
Content-Type: application/json;charset=UTF-8
Transfer-Encoding: chunked
Connection: close
X-AREQUESTID: @1Q2IL9Zx1344x744323x0
X-ASESSIONID: 13r0hpv
X-ASEN: SEN-11784298
Set-Cookie: crowd.token_key=<redacted>; Domain=<redacted>; Path=/; HttpOnly
X-AUSERID: 53
X-AUSERNAME: dfrankel
Cache-Control: no-cache, no-transform
Vary: X-AUSERNAME,Accept-Encoding
WWW-Authenticate: OAuth realm="https%3A%2F%2F<our server address>"
X-Content-Type-Options: nosniff
{"errors":[{"context":null,"message":"You are not permitted to access this resource","exceptionName":"com.atlassian.bitbucket.AuthorisationException"}]}