May 19, 2021 WeChat Mini Program Development Document
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 facet contact information
How to call:
POST https://api.weixin.qq.com/cgi-bin/express/delivery/contact/get?access_token=ACCESS_TOKEN
Property | Type | The default | Required | Description |
---|---|---|---|---|
access_token | string | Is | The interface calls the credentials | |
token | string | Is | The Token field pushed in the merchant side order event | |
waybill_id | string | Is | The ticket ID |
Property | Type | Description |
---|---|---|
waybill_id | string | The ticket ID |
sender | Array.<Object> | Sender information |
receiver | Array.<Object> | Recipient information |
errcode | number | Error code |
errmsg | string | The error message |
Sender's structure
Property | Type | Description |
---|---|---|
address | string | Address, the provincial urban information is merged |
name | string | username |
tel | string | Landline number |
mobile | string | mobile phone number |
Receiver's structure
Attributes | type | illustrate |
---|---|---|
address | string | Address, the provincial urban information is merged |
name | string | username |
tel | string | Landline number |
mobile | string | mobile phone number |
Errcode's legitimate value
value | illustrate | Minimum version |
---|---|---|
0 | success | |
-1 | Other errors | |
40199 | Welnkeer ID error, no wayfill | |
9300507 | Token is incorrect |
{
"token": "TOKEN",
"waybill_id": "12345678901234567890"
}
{
"waybill_id": "12345678901234567890",
"sender": {
"address": "广东省广州市海珠区XX路XX号XX大厦XX栋XX",
"name": "张三",
"tel": "020-88888888",
"mobile": "18666666666"
},
"receiver": {
"address": "广东省广州市天河区XX路XX号XX大厦XX栋XX",
"name": "王小蒙",
"tel": "029-77777777",
"mobile": "18610000000"
}
}
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.
openapi.logistics.getContact
Permissions for the logistics.getContact API need to be configured in config.json, details
Property | Type | The default | Required | Description |
---|---|---|---|---|
token | string | Is | The Token field pushed in the merchant side order event | |
waybillId | string | Is | The ticket ID |
Property | Type | Description |
---|---|---|
waybillId | string | The ticket ID |
sender | Array.<Object> | Sender information |
receiver | Array.<Object> | Recipient information |
errCode | number | Error code |
errMsg | string | The error message |
Sender's structure
Property | Type | Description |
---|---|---|
address | string | Address, which has merged provincial and municipal information |
name | string | The user's name |
tel | string | Landline number |
mobile | string | Mobile phone number |
The structure of the receiver
Property | Type | Description |
---|---|---|
address | string | Address, which has merged provincial and municipal information |
name | string | The user's name |
tel | string | Landline number |
mobile | string | Mobile phone number |
The legal value of errCode
Value | Description | The lowest version |
---|---|---|
0 | Success |
The exception thrown
Property | Type | Description |
---|---|---|
errCode | number | Error code |
errMsg | string | The error message |
The legal value of errCode
Value | Description | The lowest version |
---|---|---|
-1 | Other errors | |
40199 | The ticket ID was incorrect and the ticket was not found | |
9300507 | Token is incorrect |
const cloud = require('wx-server-sdk')
cloud.init()
exports.main = async (event, context) => {
try {
const result = await cloud.openapi.logistics.getContact({
token: 'TOKEN',
waybillId: '12345678901234567890'
})
return result
} catch (err) {
return err
}
}
{
"waybillId": "12345678901234567890",
"sender": {
"address": "广东省广州市海珠区XX路XX号XX大厦XX栋XX",
"name": "张三",
"tel": "020-88888888",
"mobile": "18666666666"
},
"receiver": {
"address": "广东省广州市天河区XX路XX号XX大厦XX栋XX",
"name": "王小蒙",
"tel": "029-77777777",
"mobile": "18610000000"
},
"errMsg": "openapi.logistics.getContact:ok"
}