有赞新零售社区

发帖
有赞云历史板块»自用型应用获取token 报"参数 token 无效"

自用型应用获取token 报"参数 token 无效"

53522cd635a2 2017-11-24 3835 浏览 5 评论 | 只看楼主 [打印]
使用自用型应用获取token,传入对应参数请求URL,报错,如下信息:
"error_response": {"code": 40010,"msg": "参数 token 无效"}


急!急!急!
用手机打开
收藏 ··· 回复
    八两   青铜   2017-11-25 | 只看该作者
    请提供具体请求参数,以便进一步确认。

      53522cd635a2 青铜   2017-11-27 | 只看该作者
      QunListInfoContent skus_with_json = new QunListInfoContent();
                              skus_with_json.sku_quantity = headModel.fBalQty;
                              skus_with_json.sku_price = 0;
                              skus_with_json.sku_property = "";
                              skus_with_json.sku_outer_id = "";
                              skus_with_json.sku_id = "";

                              //获取Token地址
                              string info = Function_Class.Pro_HttpPost("https://open.youzan.com/oauth/token", "client_id=XXX&client_secret=XXX&grant_type=silent&kdt_id=XXX");
                              var jObject = JObject.Parse(info);
                              Auth auth = new Token(jObject["access_token"].ToString());
                              // Auth auth = new Sign("app_id", "app_secret");
                              YZClient yzClient = new DefaultYZClient(auth);
                              Dictionary<string, object> dict = new System.Collections.Generic.Dictionary<string, object>();
                              dict.Add("num_iid", headModel.fItemNo.ToString());
                              dict.Add("offline_id", headModel.fOrgNo.ToString());
                              string sku_json = JsonFunction.SerializeObject(skus_with_json);
                              dict.Add("skus_with_json", sku_json);

                              var result = yzClient.Invoke("youzan.multistore.goods.sku.update", "3.0.0", "GET", dict, null);


            

        53522cd635a2 青铜   2017-11-27 | 只看该作者
        sku_json 为 {"sku_quantity":0.000,"sku_price":0.0,"sku_property":"","sku_outer_id":"","sku_id":""}

          53522cd635a2 青铜   2017-11-27 | 只看该作者
          Token获取正确了,但最后会返回一下信息:
          code:50000     msg:"规格应该给 1个,缺少规格或规格重复"

            有赞-饭团   游客   2017-11-27 | 只看该作者
            多网点更新库存 需要把所有规格的库存价格传完整,不论是否该规格库存价格是否有更新,参考https://www.youzanyun.com/docs/guide/3399/3423

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

              本版积分规则

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

              • 评分

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

              复制成功