有赞新零售社区

发帖
API使用问题»客户创建接口API问题

客户创建接口API问题

e525e6296d83 2019-05-10 1348 浏览 13 评论 | 只看楼主 [打印]
这个接口很奇怪,有时候有用有时候没用,求告知!感谢!!!
具体的:请求参数

                params['mobile']="45025294530"
                params['customer_create']="""{"gender":1,"name":"test"}"""
返回成功。
第二次请求只是换了个电话号码:
                params['mobile']="18810900504"
                params['customer_create']="""{"gender":1,"name":"test"}"""
返回失败代码:{u'error_response': {u'message': u'invalid params', u'code': 141500101}}
第三次请求和第一次一样:
却返回同样错误,而不是返回‘已存在’。
我的代码:
# -*- coding: utf-8 -*-
import requests
import json
class GetCustomer(object):
        """docstring for ClassName"""
        def test():
                print('helloe')
                params={}
                params['access_token']='82965e4873813846b27d12a65b37b4f7'
                params['mobile']="45025294530"
                params['customer_create']="""{"gender":1,"name":"test"}"""
                url = 'https://open.youzan.com/api/oauthentry/youzan.scrm.customer/3.0.0/create'
                print(params)
                res = requests.get(url=url, params=params,headers={'Connection':'close'})
                print(res.json())
        if __name__ == '__main__':
                test()
  


用手机打开
收藏 ··· 回复
    e525e6296d83 青铜   2019-05-10 | 只看该作者
    有赞-妮子 发表于 2019-5-9 17:14
    检查下您的参数,建议按照此格式:
    {"birthday":"1988-02-29","gender":1,"name":"李沛伦","remark":"没有 ...


    可以给你发邮箱吗

      建议您线上找技术支持,微商城后台--线上客服--技术支持
      有赞-技术支持

        e525e6296d83 青铜   2019-05-10 | 只看该作者
        问题解决了,是mobile参数不符合要求!应该用以1开头的真是号码。

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

          本版积分规则

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

          • 评分

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

          复制成功