微信小程序 小程序使用getPrinter


本文整理自网络,侵删。

logistics.getPrinter

本接口应在服务器端调用,详细说明参见服务端API。 本接口支持云调用。需开发者工具版本 >= 1.02.1904090(最新稳定版下载)
wx-server-sdk >= 0.4.0

获取打印员。若需要使用微信打单 PC 软件,才需要调用。

调用方式:

  • HTTPS 调用
  • 云调用

HTTPS 调用

请求地址

GET https://api.weixin.qq.com/cgi-bin/express/business/printer/getall?access_token=ACCESS_TOKEN

请求参数

属性 类型 默认值 必填 说明
access_token string 接口调用凭证

返回值

Object

返回数据示例

{
 "count": 2,
 "openid": [
   "oABC",
   "oXYZ"
 ],
 "tagid_list": [
   "123",
   "456"
 ]
}

云调用

云调用是小程序·云开发提供的在云函数中调用微信开放接口的能力,需要在云函数中通过 wx-server-sdk 使用。

接口方法

openapi.logistics.getPrinter
需在 config.json 中配置 logistics.getPrinter API 的权限,详情

返回值

Object

请求示例

const cloud = require('wx-server-sdk')
cloud.init()
exports.main = async (event, context) => {
  try {
    const result = await cloud.openapi.logistics.getPrinter({})
    return result
  } catch (err) {
    return err
  }
}

返回数据示例

{
  "count": 2,
  "openid": [
    "oABC",
    "oXYZ"
  ],
  "tagidList": [
    "123",
    "456"
  ],
  "errMsg": "openapi.logistics.getPrinter:ok"
}



标签:微信小程序

相关阅读 >>

sdk数据库 command索引

微信小程序 广告创建数据源

微信小程序api nfc-nfcb标签

微信小程序api 音频-创建audiocontext 对象。

微信小程序 wxml

微信小程序 用户信息-授权

微信小程序 安全指引-通用

微信小程序api 视频-保存视频

微信小程序 unbindplugin

微信小程序api 视频-拍摄或相册中选择视频

更多相关阅读请进入《微信小程序》频道 >>




打赏

取消

感谢您的支持,我会继续努力的!

扫码支持
扫码打赏,您说多少就多少

打开支付宝扫一扫,即可进行扫码打赏哦

分享从这里开始,精彩与您同在

评论

管理员已关闭评论功能...