I'm trying to access a bitbucket commit through its REST api (Could not find the proper way through Bitbucket server api). Here is the url I'm calling "http://localhost:7990/bitbucket/rest/api/1.0/projects/PROJECT_1/repos/rep_1/commits/current". It works fine on browser, and return a json about commit 'current', which has commit message, author, etc. My goal is to retrieve the commit message from it.
However, when I'm calling the same url from the bitbucket plugin I put together, it only return {"errors":[{"context":null,"message":"You are not permitted to access this resource","exceptionName":"com.atlassian.bitbucket.AuthorisationException"}]} . I'm using HttpClient and GetMethod to get the response from the url. It did not work either after adding base authentication to the url like the following:
"http://admin:admin@localhost:7990/bitbucket/rest/api/1.0/projects/PROJECT_1/repos/rep_1/commits/current", where admin has the read/write access to rep_1.
What did I miss here?