有赞新零售社区

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

客户创建接口API问题

e525e6296d83 2019-05-10 1350 浏览 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 | 只看该作者
    求大神解答!!!在线等,急急急!!

      该接口是正常的哦,建议您这边可以使用开放平台的调试工具测试验证一下,地址:https://www.youzanyun.com/docs/debugger



      有赞-技术支持

        e525e6296d83 青铜   2019-05-10 | 只看该作者
        有赞-妮子 发表于 2019-5-9 16:53
        该接口是正常的哦,建议您这边可以使用开放平台的调试工具测试验证一下,地址:https://www.youzanyun.com/ ...


        不行,还是返回:{"error_response":{"code":141500101,"message":"invalid params"}}

          您这边是用sdk还是调试工具?建议用调试工具试一下
          有赞-技术支持

            检查下您的参数,建议按照此格式:
            {"birthday":"1988-02-29","gender":1,"name":"李沛伦","remark":"没有啥","contact_address":{"address":"新风南里","area_code":518001}}
            有赞-技术支持

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


              刚用的调试工具,参数是:{"birthday":"1988-02-29","gender":1,"name":"李沛伦","remark":"没有啥","contact_address":{"address":"新风南里","area_code":518001}} , 返回:{"error_response":{"code":141500101,"message":"invalid params"}}

                e525e6296d83 青铜   2019-05-10 | 只看该作者

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


                  我截了图给你看看

                    提供下token
                    有赞-技术支持

                      e525e6296d83 青铜   2019-05-10 | 只看该作者


                      发这里不好吧

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

                        本版积分规则

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

                        • 评分

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

                        复制成功