7x9hour
9:00am - 6:00pm
free pre-sales hotline
13338363507
其它接入
客服接入
API指南
SDK用法
非SDK对接需知

测试阶段的t和secret可以先用demo账号来测试:

AppID(应用ID):demo
AppSecret(应用密钥):找开发对接人员要

正式上线的时候需要换成您自己后台获取的企业id和企业应用秘钥


(一)请求地址:

  1. 建档顾客: http://api.qique.cn/index.php?r=data/api/addcustomer    (post方式)

  2. 编辑顾客基础信息:http://api.qique.cn/index.php?r=data/api/editcustomer    (post方式)

  3. 获取顾客的钱包变动记录: http://api.qique.cn/index.php?r=data/api/getwalletchangelist    (post方式)

  4. 调整余额/佣金/积分数量: http://api.qique.cn/index.php?r=data/api/changewallet    (post方式)

  5. 用顾客ID获取顾客信息: http://api.qique.cn/index.php?r=data/api/getcusinfobycusid    (get方式)

  6. 用顾客手机号获取顾客信息: http://api.qique.cn/index.php?r=data/api/getcusinfobycusid    (get方式)

  7. 获得某个时间点之后的所有聊天记录: http://api.qique.cn/index.php?r=data/api/getallchathistorybytime    (get方式)

  8. 获得某个顾客某个时间点之后的聊天记录: http://api.qique.cn/index.php?r=data/api/getchathistorybyopenid    (get方式)

  9. 给某个手机号发送短信: http://api.qique.cn/index.php?r=data/api/sendmsgtotel    (get方式)

  10. 通过openId获取顾客在企雀的id: http://api.qique.cn/index.php?r=data/api/getcustomerinfo    (get方式)

  11. 给某个顾客发送一张卡或优惠券: http://api.qique.cn/index.php?r=data/api/sendcardorcoupons    (get方式)

  12. 获取线上支付订单和退款订单: http://api.qique.cn/index.php?r=data/api/getonlineorders    (get方式)

  13. 对特定线上订单进行发货或核销处理: http://api.qique.cn/index.php?r=data/api/delivery    (get方式)

  14. 获取线上商品/拼团列表: http://api.qique.cn/index.php?r=data/api/getgoodslist    (get方式)

  15. 获取某个在线订单的订单和商品的信息: http://api.qique.cn/index.php?r=data/api/getorderdetail    (get方式)

  16. 获取预约列表: http://api.qique.cn/index.php?r=data/api/getappointmentlist    (get方式)

  17. 创建一条预约记录: http://api.qique.cn/index.php?r=data/api/addoneappointment    (get方式)

  18. 修改一条预约记录: http://api.qique.cn/index.php?r=data/api/changeappointment    (get方式)

  19. 取消一条预约记录: http://api.qique.cn/index.php?r=data/api/cancelappointment    (get方式)

  20. 获取线下订单购买记录: http://api.qique.cn/index.php?r=data/api/getofflineproducts    (get方式)

  21. 获取线下订单划扣记录: http://api.qique.cn/index.php?r=data/api/getofflineexcute    (get方式)

  22. 线下erp生成一条购买记录: http://api.qique.cn/index.php?r=data/api/offlinebuy    (get方式)

  23. 线下erp生成一条划扣记录: http://api.qique.cn/index.php?r=data/api/offlineexcute    (get方式)

  24. 线下erp创建一条回访记录: http://api.qique.cn/index.php?r=data/api/newreturnvisit(get方式)

  25. 线下erp编辑一条回访记录: http://api.qique.cn/index.php?r=data/api/editreturnvisit(get方式)

  26. 线下erp删除一条回访记录: http://api.qique.cn/index.php?r=data/api/deletereturnvisit (get方式)


(二)签名:

  1. 对所有的请求参数(不含sign参数)进行ksort排序

  2. 排序后的请求参数按key1value1key2value2key3value3进行字符拼接

  3. 拼接后的内容需再拼接企雀后台提供的机构私钥(appSecret)以及 技术服务商的私钥 (distributionAppSecret)


    md5前的拼接顺序:
    机构私钥(appSecret)+技术服务商私钥(distributionAppSecret)+参数拼接内容(text)+机构私钥(appSecret)

    备注:拼接顺序可以参考下面的举例代码


  4. 对字符穿进行md5加密处理

    经过以上4个步骤即可获得对应的sign参数


生成签名举例:

    public static function sign($appSecret, $distributionAppSecret,$params, $method = 'md5')
    {

        if (!is_array($params)) {
            $params = array();
        }
        ksort($params);
        $text = '';
        foreach ($params as $k => $v) {
            $text .= $k . $v;
        }
        return self::hash($method, $appSecret .$distributionAppSecret. $text . $appSecret);
    }

    private static function hash($method, $text)
    {
        switch ($method) {
            case 'md5':
            default:
                $signature = md5($text);
                break;
        }
        return $signature;
    }


(三)请求参数&返回字段:

post表单提交方式:form-data

每个接口都需要有以下通用参数:

t 必填 企业ID
dis 必填 技术服务商ID
timeStamp 必填 请求时间 Y-m-d H:i:s格式
format 必填 请求格式 'json'
v 必填 版本号 '2.0'
sign 必填 对当前请求参数(除了sign本身)加密后的签名
signMethod 必填 加密方式 'md5'

    

各接口额外需传入的参数和返回字段说明:


新建顾客信息为例:

    /** 
     * 在系统里新建一个顾客
     * @param  [type]  $name            必填:顾客名称
     * @param  [type]  $telnum          必填:顾客手机号(唯一)
     * 
     * @param  [type]  $erpId           选填:指定会员id (数字,不超过11位,唯一)
     * @param  [type]  $uuid            选填:外部id (不超过32位,唯一)
     * @param  integer $sex             选填:顾客性别:(1:男,2:女)
     * @param  [type]  $birthday        选填:生日 Y-m-d
     * @param  [type]  $province        选填:-省份-城市-区县 eg: -辽宁省-锦州-黑山县
     * 
     * @param  [type]  $channelName     选填:渠道名称(和系统内保持一致,系统内没有的时候会新建)
     * @param  string  $channelUserName 选填:渠道人员名称(和系统内保持一致,系统内没有的时候会新建)
     * @param  string  $preConsultName  选填:网电人员名字(和系统内保持一致,系统内没有的时候会新建)
     * @param  string  $ownerName       选填:建档人员名字(和系统内保持一致,系统内没有的时候会新建)
     * @param  string  $description     选填:网电备注(和系统内保持一致,系统内没有的时候会新建)
     * @param  string  $teamId          选填:该顾客所属分店的id
     * @return [type]             
        {
            errNum: xx(0说明接口返回成功,非0说明是产生了错误),
            errMsg: errNum为非0时会带上这个错误信息
        }
     */
    public function actionAddcustomer($name, $telnum, $erpId = null, $sex = 0, $birthday = null, $channelName = null, $channelUserName = '', $preConsultName = '', $ownerName = '', $description = '', $uuid = null, $province = null, $teamId = null){

以上函数说明传入参数为:

name            必填:顾客名称
telnum          必填:顾客手机号
erpId           选填:指定会员id (数字,不超过11位,唯一)
sex             选填:顾客性别:(1:男,2:女)
birthday        选填:生日 Y-m-d
channelName     选填:渠道名称(和系统内保持一致,系统内没有的时候会新建)
channelUserName 选填:渠道人员名称(和系统内保持一致,系统内没有的时候会新建)
preConsultName  选填:网电人员名字(和系统内保持一致,系统内没有的时候会新建)
ownerName       选填:建档人员名字(和系统内保持一致,系统内没有的时候会新建)
description     选填:网电备注(和系统内保持一致,系统内没有的时候会新建)


返回字段为:

{
     errNum: xx(0说明接口返回成功,非0说明是产生了错误),
     errMsg: errNum为非0时会带上这个错误信息
}


编辑顾客基础信息:

/**
 * 编辑顾客基础信息
 * 请求地址:http://api.qique.cn/index.php?r=data/api/editcustomer
 * 请求方式:POST
 *
 * cusId和telnum至少传一项,cusId优先。只更新传入且有效的字段,空值或非法值不会覆盖原值。
 *
 * 定位参数:
 * cusId    选填:顾客id
 * telnum   选填:顾客手机号
 *
 * 可更新字段:
 * name                            顾客名称
 * sex                             顾客性别:1男,2女
 * birthday                        生日,格式 Y-m-d
 * identityId                      身份证号
 * telnum                          认证手机号
 * telnum1                         未认证手机号1
 * telnum2                         未认证手机号2
 * telnum3                         未认证手机号3
 * province                        省市区
 * channelId                       渠道id
 * uid                             渠道人员id
 * ownerId                         建档人员id
 * consultId                       现场咨询师id
 * preConsultId                    网电人员id
 * consultAssistantId              咨询助理id
 * consultAssistantId1             咨询助理1id
 * consultAssistantId2             咨询助理2id
 * consultAssistantId3             咨询助理3id
 * consultAssistantId4             咨询助理4id
 * intention                       顾客意向度,1-5
 * isBigOrder                      是否大单:0否,1是
 * medicalNumber                   病历号
 * description                     备注
 * description1                    备注1
 * erpId                           会员id
 * job                             职业
 * mail                            邮箱
 * address                         地址
 * wechatId                        微信号
 */
public function actionEditcustomer($cusId = null, $telnum = null)


返回字段为:

{
     errNum: 0,
     cusId: 123,
     updatedFields: ['name', 'birthday'],
     ignoredFields: []
}


↓ scan the code to add MihuOsadvisor ↓
learn more about mathematical scenarios ↑
useful it’s useless share on WeChat

open WeChat to’ scan ’and forward to a friend

open within mini app

open WeChat’ scan ’and open it in the mini app