有赞新零售社区

发帖
API使用问题»商家自有接入

商家自有接入

极行客 2017-01-11 2480 浏览 3 评论 | [显示全部楼层] [打印]
接口相关
店铺名称: 极行客
https://github.com/rayqian/youzan-sdk

官网的  node.js sdk

问题是 获取商品 好用, 但是添加商品 报 40005 错误


{"price":376.21,"title":"City Sightseeing","is_virtual":1,"post_fee":1.21}
(node:8808) UnhandledPromiseRejectionWarning: Unhandled promise rejection (rejec
tion id: 1): {
        "error_response": {
                "code": 40005,
                "msg": "??????"
        }
}


var SDK = require('youzan-sdk');
var sdk = SDK({key: 'xxxxxx', secret: 'xxxxxxx'});
// 初始化SDK,在 https://koudaitong.com/v2/apps/open/setting 开启API接口,复制相应 AppID、AppSecert
export function getYouzan(req, res) {
  sdk.get('kdt.items.onsale.get', {}).then(function(youzanProduct) {
    // do some thing with data
    res.json({youzanProduct});
  });

}


export function addYouzan(req, res) {
  console.log(req.body.product)
    sdk.post('kdt.item.add', req.body.product,{}).then(function(data) {
      // make some thing

      res.json({data});
    });
}

本帖最后由 极行客 于 2017-1-10 17:25 编辑
用手机打开
收藏 ··· 回复
    40005签名校验失败:检查 AppId 和 AppSecret 是否正确;如果是自行开发的协议分装,请检查代码。

    你的签名有问题哦
    提问请先戳这儿——》[搜索]
    您的大多数问题,新手学堂都有答案,戳这儿——》[帮助中心]

      极行客 发表于 2017-1-10 17:38
      Appid 和 App secret 肯定是正确的


      麻烦把你最终的http请求发一下,我们看下
      提问请先戳这儿——》[搜索]
      您的大多数问题,新手学堂都有答案,戳这儿——》[帮助中心]

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

        本版积分规则

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

        • 评分

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

        复制成功