0

有任何方法可以让所有聊天从 zendesk 到网站。我正在使用 zendesk api 获取所有聊天记录: curl https://www.zopim.com/api/v2/chats \ -v -u {email_address}:{password}

这是我的代码:

public function getChat_messages(){
    $sUrl = "https://www.zopim.com/api/v2/chats";
    $authorization = "Authorization: Bearer a362fb582520105c720000631000d6f6f81111f0c95489b9673e722f5c59bf0";
    $key= "-v -u email:password";
    if (is_resource($rCh = curl_init($sUrl))) {
        curl_setopt($rCh, CURLOPT_HTTPHEADER, array('Content-Type: application/json' , 'Authorization: Bearer a362fb582520105c720000631000d6f6f81111f0c95489b9673e722f5c59bf0',
            '-v -u email:password',
    ));
        curl_setopt($rCh, CURLOPT_RETURNTRANSFER, 1);
        curl_setopt($rCh, CURLOPT_TIMEOUT, 3); 
        $arrResult = curl_exec($rCh); 
        $arrResult = explode("\n", $arrResult);
        $response = curl_exec($rCh);
        $err = curl_error($rCh);
        curl_close($rCh);
    }
    print_r($response);
}

帮助将不胜感激..

谢谢.. :)

4

1 回答 1

0

你做得很好,但有一个小错误。

$sUrl = "https://www.{your_domain_name}.com/api/v2/chats";

您只需复制并粘贴这就是您收到错误的行。

zopim不是您的域名 使用您的域名代替 zopim

于 2019-11-29T07:17:40.060 回答