【问题标题】:GET /tasks does not workGET /tasks 不起作用
【发布时间】:2016-01-26 16:51:13
【问题描述】:

我正在使用查询任务方法:https://asana.com/developers/api-reference/tasks#query 使用以下代码片段:

    String url = API_BASE+"/tasks?completed_since=now";
    System.out.println(url);
    HttpGet httpget = new HttpGet(url);

    httpget.addHeader( BasicScheme.authenticate(creds, "US-ASCII", false) );

    ResponseHandler<String> responseHandler = new BasicResponseHandler();

    String responseBody = httpclient.execute(httpget, responseHandler);

错误:

https://app.asana.com/api/1.0/tasks?completed_since=now
null
org.apache.http.client.HttpResponseException: Bad Request
    at org.apache.http.impl.client.BasicResponseHandler.handleResponse(BasicResponseHandler.java:67)
    at org.apache.http.impl.client.BasicResponseHandler.handleResponse(BasicResponseHandler.java:54)
    at org.apache.http.impl.client.AbstractHttpClient.execute(AbstractHttpClient.java:735)
    at org.apache.http.impl.client.AbstractHttpClient.execute(AbstractHttpClient.java:709)
    at org.apache.http.impl.client.AbstractHttpClient.execute(AbstractHttpClient.java:700)

【问题讨论】:

  • 如果您将 URL 传递到浏览器的地址栏中,它是否有效?
  • 谢谢,项目丢失

标签: java asana asana-api


【解决方案1】:

我在 Asana 工作。

是的,来自服务器的底层消息是:

“必须准确指定项目、标签或受理人+工作区之一”

我们将看看为此更新文档,因为它似乎确实对此很明确。

我强烈建议使用示例中所示的 url。

此外,我们还有一个 Java 客户端库,您可能会发现它很有用:https://github.com/Asana/java-asana

感谢您提出文档问题。

【讨论】:

    【解决方案2】:

    看起来项目是文档中缺少的必需参数。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2015-02-18
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多