有赞新零售社区

发帖
API使用问题»调用获取客户列表接口产生异常

调用获取客户列表接口产生异常

恭喜发车运营专员 2018-10-27 1719 浏览 4 评论 | [显示全部楼层] [打印]
参考API文档示例的PHP代码如下:
    require_once __DIR__ . '/lib/YZGetTokenClient.php';
    require_once __DIR__ . '/lib/YZTokenClient.php';
   
    $client_id = "应用client_id"; //请填入有赞云控制台的应用client_id
    $client_secret = "应用client_secret"; //请填入有赞云控制台的应用client_secret
    $token_client = new YZGetTokenClient( $client_id , $client_secret );
    $type = 'self';
    $keys['kdt_id'] = '店铺ID'; // 店铺ID
    $token_data = $token_client->get_token( $type , $keys );


    $client = new YZTokenClient($token_data['access_token']);


    $method = 'youzan.scrm.customer.search'; //要调用的api名称
    $api_version = '3.1.0'; //要调用的api版本号
    $my_params = [
        'is_member' => '0',
    ];
    $my_files = [
    ];
    var_dump(
        $client->post($method, $api_version, $my_params, $my_files)
    );
运行结果:
Fatal error: Uncaught exception 'Exception' with message 'response invalid, data: ' in /Users/youzan/lib/YZTokenClient.php:36
Stack trace:
#0 /Users/youzan/lib/YZTokenClient.php(22): YZTokenClient->parse_response(false)
#1 /Users/youzan/customer_search.php(24): YZTokenClient->post('youzan.scrm.cus...', '3.1.0', Array, Array)


用手机打开
收藏 ··· 回复
    河沙   青铜   2018-12-07 显示全部楼层
    看上去是CURL的问题,我今天也遇上了,服务器端升级了CURL库

      1跳至
      您需要登录后才可以回帖 登录 | 立即注册

      本版积分规则

      复制链接
      新浪微博
      QQ空间
      微信扫码
      • 回复

      • 评分

      客服工作时间是9:00-18:00,客服妹子当前不在线,若不能及时回复请谅解。试试右上角的搜索吧,论坛有丰富的经验贴、公告贴,相信一定能够帮到您~

      复制成功