【问题标题】:Clio api V4 updated since paramter not working由于参数不起作用,Clio api V4 已更新
【发布时间】:2018-01-29 21:55:22
【问题描述】:

Clio api 的新手,但我正在尝试使用 Clio Api 通过以下代码提取活动列表。我得到的只是一个空字符串,没有错误或错误号为零。如果没有日期,我会得到一份我所有活动的清单。

 $header = 'Authorization: bearer ' . $this->token;
 $ch = curl_init();
// date hardcoded for sample
 $url=   $this->base . $this->API_version . "activities?updated_since=2012-10-12T14:15:16 -0500" ;

curl_setopt($ch, CURLOPT_URL, $url);

curl_setopt($ch, CURLOPT_HTTPHEADER, array($header));
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, 'GET');
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);

$response = curl_exec($ch);
die('Error: "' . curl_error($ch) . '" - Code: ' . curl_errno($ch));

【问题讨论】:

    标签: clio-api


    【解决方案1】:

    Clio API 调用中使用的任何日期都需要按照此处 REST 端点文档中指定的字符串形式提供:
    https://app.clio.com/api/v4/documentation

    对于您的特定模型:活动文档在此处: https://app.clio.com/api/v4/documentation#tag/Activities

    updated_since [字符串] 将活动记录过滤到那些 在特定时间后拥有 updated_at 字段。 (预计 ISO-8601 时间戳)。

    以下是创建时间的符合 ISO-8601 的时间戳:

    created_since=2017-12-29T16:27:15+01:00

    created_since=2017-12-29T16:27:15Z

    这不符合 ISO-8601 标准。

    created_since=2017-12-29T16:27:15 +01:00

    (空格)[ASCII-32] 字符在 ISO-8601 字符串中不被接受

    https://en.wikipedia.org/wiki/ISO_8601

    【讨论】:

      【解决方案2】:

      尝试使用 curl_setopt($ch, CURLOPT_COOKIEJAR, $cookie_jar);

      还有你的完整网址是什么?

      【讨论】:

      • cookie_jar 没有乐趣。完整的网址是
      【解决方案3】:

      解决方案是在日期末尾删除时区“-0500”。一旦放下它就可以正常工作。

      【讨论】:

        猜你喜欢
        • 2022-11-01
        • 1970-01-01
        • 2017-09-13
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 2019-12-23
        相关资源
        最近更新 更多