Detailed explanation of express query steps for WeChat development

Y2J
Release: 2017-05-13 14:50:06
Original
2284 people have browsed it

1. Request data

Express 100 provides an express query interface.

By sending a request to the specified address, you can return something like JSON, XML and other formats of tracking results

  • 3. Request address

  • api.kuaidi100.com/api ?id=[]&com=[]&nu=[]&valicode=[]&show=[0|1|2|3]&muti=[0|1]&order=[desc|asc]

  • (Please replace the square brackets in the above address with the corresponding values ​​below before using)

4. Enter the parameters

valicodeshow0: Returns jsonmuti1: Return multiple lines of complete information, orderdesc: sorted by time from new to old, 5. Return results
Name Type Required Description
id String is identity authorizationkey, please express the query interface to apply (case sensitive)
com String is the courier company code to be queried by . Chinese is not supported. For the corresponding company code, see
"Explanation of courier companies and parameters supported by API URL" ” and “Supported International Express Delivery and Parameter Description”.
If you can't find the company you need, please send an email to kuaidi@kingdee.com for consultation (case insensitive)
nu String is the express tracking number to be queried. Please do not bring special symbols. Chinese is not supported (case insensitive)
String is a deprecated field, meaningless, please ignore.
String is return type: String
, 1: Return xmlobject
, 2: Return the html object, 3: Return the text text.
If not filled in, a json string will be returned by default.

String is The number of information returned: 0: Only one line of information is returned.
If not filled in, multiple lines will be returned by default.

String is sorting: asc: Arranged by time from oldest to newest.
If not filled in, the default is to return in reverse order (case insensitive)

Field name comnutimecontextstate status of the express orderstatus0: No result for logistics order, messageconditionischeck

6. Return example


JSON format

{"message":"ok","status":"1","state":"3","data":
[{"time":"2012-07-07 13:35:14","context":"客户已签收"},
 {"time":"2012-07-07 09:10:10","context":"离开 [北京石景山营业厅] 派送中,递送员[温],电话[]"},
 {"time":"2012-07-06 19:46:38","context":"到达 [北京石景山营业厅]"},
 {"time":"2012-07-06 15:22:32","context":"离开 [北京石景山营业厅] 派送中,递送员[温],电话[]"},
 {"time":"2012-07-06 15:05:00","context":"到达 [北京石景山营业厅]"},
 {"time":"2012-07-06 13:37:52","context":"离开 [北京_同城中转站] 发往 [北京石景山营业厅]"},
 {"time":"2012-07-06 12:54:41","context":"到达 [北京_同城中转站]"},
 {"time":"2012-07-06 11:11:03","context":"离开 [北京运转中心驻站班组] 发往 [北京_同城中转站]"},
 {"time":"2012-07-06 10:43:21","context":"到达 [北京运转中心驻站班组]"},
 {"time":"2012-07-05 21:18:53","context":"离开 [福建_厦门支公司] 发往 [北京运转中心_航空]"},
 {"time":"2012-07-05 20:07:27","context":"已取件,到达 [福建_厦门支公司]"}
]}
Copy after login

At the same time, Express 100 provides a Wap version query interface for
wap.kuaidi100.com/

The URL request is

http://wap.kuaidi100.com/wap_result.jsp?rand=35447&id=shentong&fromWeb=null&postid=568629598688&sub=%E6%9F%A5%E8%AF%A
Copy after login

The parameters are as follows:


rand 随机数
id 快递公司名称,此处shentong就是申通
fronweb 是否从web提交
postid 快递号码,此处为 568629598688
sub 一个固定字段, %E6%9F%A5%E8%AF%A2解码后为 查询 两个汉字
Copy after login

Therefore, we use the above as the standard to construct the query request.

2. Program implementation

Core code

##2. Effect demonstration

[Related recommendations]

1.

Special recommendation: "php Programmer Toolbox" V0.1 version download

2.

WeChat public account platform source code download

3.

WeChat Free download of voting source code

Field meaning
Logistics company number
Logistics Order number
Time of each tracking message
Each tracking message Description of the information
The current : 0: In transit, that is, the goods are in the process of transportation; 1: Pick up, the goods have been picked up by the express company and the first tracking information has been generated;
2: Difficulty, the goods delivery process has gone wrong solved the problem;
3: Sign for receipt, the recipient has signed for receipt;
4: Return for signature, that is, the goods are returned due to the user's refusal to sign, out of area, etc., and the sender has signed for receipt;
5: Dispatch , that is, the express delivery is in progress in the same city;
6: Return, the goods are on the way back to the sender;
This status is still being improved. If you have more parameter requirements, please send an email to Submitted by kuaidi@kingdee.com.

Query result status: 1: Query successful,
2: An exception occurred in the interface,

is meaningless, please ignore
No meaning, please ignore
No meaning, please ignore

The above is the detailed content of Detailed explanation of express query steps for WeChat development. For more information, please follow other related articles on the PHP Chinese website!

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!