Bitbucket API 创建新问题 401 未经授权

Bitbucket API Create New Issue 401 Unauthorized

我正在使用 OkHttp 向 Bitbucket API 发出 POST 请求以创建新问题。他们的 documentation 说私人仓库或私人问题跟踪器需要身份验证才能使用此 API 创建新问题。我的回购和我的问题跟踪器都是 public 所以应该没有任何问题。但是,当我打电话创建新问题时,我收到 401 未经授权的响应。这是我用来拨打电话的代码:

FormEncodingBuilder builder = new FormEncodingBuilder();
String t = "{" +
           "\"status\": \"new\"," +
           "\"priority\": \"trivial\"," +
           "\"title\": \"This is a title\"," +
           "\"content\": \"This is the content\"," +
           "\"is_spam\": false\n" +
           "}";
RequestBody requestBody = RequestBody.create(MediaType.parse("application/json; charset=utf-8"), t);
String url = "https://bitbucket.org/api/1.0/repositories/userName/repoName/issues"
Request request = new Request.Builder().url(url)
                                       .post(requestBody)
                                       .build();
Response response = new OkHttpClient().newCall(request).execute();

问题: 谁能告诉我为什么我会收到未经授权的回复?

更新
根据 Jim Redmond,我已将请求更改为先进行身份验证。我现在正在 POST 到 https://bitbucket.org/site/oauth2/authorize?client_id=myConsumerKey&response_type=token 并且我得到响应 200 OK 但我没有在 headers 中看到令牌......知道为什么我没有得到令牌响应?

如文档中所述,此方法需要身份验证。您的回购或问题跟踪器是否 public 并不重要;还需要一个 "reported_by" 用户。