有赞新零售社区

发帖
API使用问题»python客户端返回:token无效,该token不存在或

python客户端返回:token无效,该token不存在或

卡卡有礼 2019-05-21 3034 浏览 3 评论 | 只看楼主 [打印]
我通过POST https://open.youzanyun.com/auth/token获得的token,有效期是5月28日,为什么用这个token调用python客户端,返回
打印:{"error_response":{"code":40010,"msg":"参数 token 无效","sub_code":10000,"sub_data":"","sub_msg":"token无效,该token不存在或已过期"}}
我在调试工具里面:https://www.youzanyun.com/docs/debugger
也是同样结果


代码如下:
token = auth.Token(token='具体token')
client = YZClient(token)

params = {}

params['item_id'] = "471456482"

files = []

print client.invoke('youzan.item.get', '3.0.0', 'GET', params=params, files=files)
用手机打开
收藏 ··· 回复
    首先确认下您这边生成的token是有赞云还是开放平台的?
    有赞云的token无法在开放平台调试工具上验证测试
    有赞-技术支持

      卡卡有礼 青铜   2019-05-22 | 只看该作者
      有赞-妮子 发表于 2019-5-21 14:53
      首先确认下您这边生成的token是有赞云还是开放平台的?
      有赞云的token无法在开放平台调试工具上验证测试 ...


      怎么确定token是有赞云还是开放平台的?
      我是通过以下方式获得的token
      curl -X POST https://open.youzanyun.com/auth/token -H 'content-type: application/json' -d '{"client_id": "*****","client_secret": "****","authorize_type": "silent", "grant_id": "****"}'

        有赞-技术支持

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

          本版积分规则

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

          • 评分

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

          复制成功