Coding With Fun
Home Docker Django Node.js Articles Python pip guide FAQ Policy

WeChat small programs Small programs use getAllAccount


May 19, 2021 WeChat Mini Program Development Document


Table of contents


logistics.getAllAccount

This interface should be called on the server side, as detailed in the Service Side API.
This interface supports cloud calls. Developer tool version required . . . 1.02.1904090 (latest stable download)
wx-server-sdk >= 0.4.0

Get all bound logistics accounts

How to call:

  • HTTPS call
  • Cloud calls

HTTPS call

The request address

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

Request parameters

Property Type The default Required Description
access_token string Is The interface calls the credentials

Returns a value

Object

Property Type Description
errcode number Error code
errmsg number The error message
count number Number of accounts
list Array.<Object> The list of accounts

The legal value of errcode

Value Description The lowest version
0 Success
-1 The system failed

The structure of the list

Property Type Description
biz_id string Courier company customer code
delivery_id string Courier company ID
create_time number Account binding time
update_time number Account update time
status_code number The binding state
alias string Account alias
remark_wrong_msg string Error message for account binding failure (EMS audit results)
remark_content string Notes when account binding (submitted for EMS review required)
quota_num number The balance of the electronic face list
quota_update_time number Electronic bill balance update time
service_type Array.<Object> The type of service supported by the binding account

list.status_code legal value of the data

Value Description The lowest version
0 The binding was successful
1 under review
2 Binding failed
3 Tied

List.service_type structure

Property Type Description
service_type number Service type ID
service_name string The name of the service type

Return an example of the data

{
       "count": 1,
       "list": [
           {
               "biz_id": "123456789",
               "delivery_id": "YUNDA",
               "create_time": 1555482786,
               "update_time": 1556594799,
               "status_code": 0,
               "alias": "",
               "remark_wrong_msg": "",
               "remark_content": "",
               "quota_num": 55,
               "quota_update_time": 1556594799
           }
       ]
   }

Cloud calls

Cloud call is the ability provided by the small program Cloud Development to call WeChat open interfaces in cloud functions and need to be used in cloud functions via wx-server-sdk.

The interface method

openapi.logistics.getAllAccount
Permissions for the logistics.getAllAccount API need to be configured in config.json, details

Returns a value

Object

Property Type Description
errCode number Error code
errMsg number The error message
count number Number of accounts
list Array.<Object> The list of accounts

The legal value of errCode

Value Description The lowest version
0 Success

The structure of the list

Property Type Description
bizId string Courier company customer code
deliveryId string Courier company ID
createTime number Account binding time
updateTime number Account update time
statusCode number The binding state
alias string Account alias
remarkWrongMsg string Error message for account binding failure (EMS audit results)
remarkContent string Notes when account binding (submitted for EMS review required)
quotaNum number The balance of the electronic face list
quotaUpdateTime number Electronic bill balance update time
serviceType Array.<Object> The type of service supported by the binding account

The legal value of list.statusCode

Value Description The lowest version
0 The binding was successful
1 Under review
2 The binding failed
3 Untied

The structure of list.serviceType

Property Type Description
serviceType number Service type ID
serviceName string The name of the service type

Abnormal

Object

The exception thrown

Property Type Description
errCode number Error code
errMsg number The error message

The legal value of errCode

Value Description The lowest version
-1 The system failed

An example of a request

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

Return an example of the data

{
  "count": 1,
  "list": [
    {
      "alias": "",
      "bizId": "123456789",
      "deliveryId": "YUNDA",
      "createTime": 1555482786,
      "updateTime": 1556594799,
      "statusCode": 0,
      "remarkWrongMsg": "",
      "remarkContent": "",
      "quotaNum": 55,
      "quotaUpdateTime": 1556594799
    }
  ],
  "errMsg": "openapi.logistics.getAllAccount:ok"
}