有赞新零售社区

发帖
API使用问题»接口 customer.create 创建客户 错误

接口 customer.create 创建客户 错误

2d990e7623c1 2018-07-17 1140 浏览 1 评论 | 只看楼主 [打印]
接口 youzan.scrm.customer.create 创建客户 错误
YZClient client = new DefaultYZClient(new Token("25eff848da19383098f2840b7dc18457")); //new Sign(appKey, appSecret)
YouzanScrmCustomerCreateParams youzanScrmCustomerCreateParams = new YouzanScrmCustomerCreateParams();
CommuDic dic =new CommuDic();
CommuDic contact_address =new CommuDic();
dic.put("name","青青");
dic.put("gender",0);
dic.put("birthday","1989-01-01");
dic.put("remark","OK");
contact_address.put("area_code",210224);
contact_address.put("address","bbb");
dic.put("contact_address",contact_address);
youzanScrmCustomerCreateParams.setMobile("13858143440");
youzanScrmCustomerCreateParams.setCustomerCreate(dic.toString());
YouzanScrmCustomerCreate youzanScrmCustomerCreate = new YouzanScrmCustomerCreate();
youzanScrmCustomerCreate.setAPIParams(youzanScrmCustomerCreateParams);
YouzanScrmCustomerCreateResult result = client.invoke(youzanScrmCustomerCreate);
dic.toString()={name=青青, gender=0, birthday=1989-01-01, remark=OK, contact_address={area_code=210224, address=bbb}}
报错 {"error_response":{"code":0,"message":"Invalid <customerCreate> type, expects object"}}
用手机打开
收藏 ··· 回复
    有赞-饭团   游客   2018-07-18 | 只看该作者
    参考示例代码
    youzanScrmCustomerCreateParams.setMobile("19657482368");
    youzanScrmCustomerCreateParams.setCustomerCreate("{"name":"JJBB","gender":1,"birthday":"2017-01-01","remark":"OK","contact_address":{"area_code":210224,"address":"大傻子"}}");
    如果用的别的语言,请对照修改

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

      本版积分规则

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

      • 评分

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

      复制成功