1688-open-sdk
TypeScript icon, indicating that this package has built-in type declarations

0.1.1 • Public • Published

1688-open-sdk

1688开放平台node sdk,因官方没有提供node版本sdk,因此提供非官方版,希望对大家有用,欢迎issue和pr。

1688开放平台

安装

使用npm:

npm i 1688-open-sdk -S

或者yarn:

yarn add 1688-open-sdk

引入文件

import ApiExecutor from "1688-open-sdk"

或者

const ApiExecutor = require("1688-open-sdk")

配置

使用1688开放平台的appkey,appsecret进行初始化:

const apiExecutor = new ApiExecutor(process.env.APPKEY, process.env.APPSECRET)

API

// 使用refreshToken更新AccessToken

const {access_token} = await apiExecutor.refreshToken2AccessToken(refresh_token)

例如 跨境产品以图搜图:

apiExecutor.execute(
    'com.alibaba.linkplus/alibaba.cross.similar.offer.search',
    {
        picUrl:'https://img.alicdn.com/imgextra/i1/O1CN01PwAoB21LuSuZE9Oqx_!!6000000001359-2-tps-1170-597.png',
        page: 1
    },
    access_token
)

注意调用api返回的都是promise,因此可使用async/await。

Readme

Keywords

Package Sidebar

Install

npm i 1688-open-sdk

Weekly Downloads

10

Version

0.1.1

License

MIT

Unpacked Size

1.35 MB

Total Files

11

Last publish

Collaborators

  • wangjue666