logistics.getPrinter

本接口应在服务器端调用,详细说明参见服务端API

本接口支持云调用。需开发者工具版本 >= 1.02.1904090(最新稳定版下载),wx-server-sdk >= 0.4.0

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

调用方式:

HTTPS 调用

请求地址

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

请求参数

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

返回值

Object

返回数据示例

  1. {
  2. "count": 2,
  3. "openid": [
  4. "oABC",
  5. "oXYZ"
  6. ],
  7. "tagid_list": [
  8. "123",
  9. "456"
  10. ]
  11. }

云调用

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

接口方法

  1. openapi.logistics.getPrinter

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

返回值

Object

请求示例

  1. const cloud = require('wx-server-sdk')
  2. cloud.init()
  3. exports.main = async (event, context) => {
  4. try {
  5. const result = await cloud.openapi.logistics.getPrinter({})
  6. console.log(result)
  7. return result
  8. } catch (err) {
  9. console.log(err)
  10. return err
  11. }
  12. }

返回数据示例

  1. {
  2. "count": 2,
  3. "openid": [
  4. "oABC",
  5. "oXYZ"
  6. ],
  7. "tagidList": [
  8. "123",
  9. "456"
  10. ],
  11. "errMsg": "openapi.logistics.getPrinter:ok"
  12. }