GuzzleHTTP响应400状态

时间:2018-05-29 19:23:06

标签: php zoho guzzlehttp

我一直在使用GuzzleHttp,这是我的代码片段,这似乎以某种方式管理GuzzleHTTP中的Session。

    $this->httpMethod=='GET';
    if(!empty($this->httpMethod) && $this->httpMethod=='POST'){
        $response = $this->client->post($finalUrl);
    }else{
        $response = $this->client->request($this->httpMethod, $finalUrl);
    }

不幸的是,我收到了致命错误 -

Fatal error: Uncaught GuzzleHttp\Exception\ClientException: Client error: `GET https://creator.zoho.com/api/json/test/view/All_SMS?zc_ownername=zc_owner&raw=1&authtoken=auth_token&scope=crmapi` resulted in a `400 Bad Request` response:
{"code":2945,"message":"DATATYPE_NOT_MATCHED"}

1 个答案:

答案 0 :(得分:1)

查看Zoho API error codes

代码2945是无效的票证。

如果不深入研究API文档,我怀疑它是an authentication problem