Download the PHP package 51tracking/51tracking-sdk-php without Composer
On this page you can find all versions of the php package 51tracking/51tracking-sdk-php. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download 51tracking/51tracking-sdk-php
More information about 51tracking/51tracking-sdk-php
Files in 51tracking/51tracking-sdk-php
Package 51tracking-sdk-php
Short Description The PHP SDK of 51Tracking API
License MIT
Informations about the package 51tracking-sdk-php
51Tracking API PHP SDK
The PHP SDK of 51Tracking API
Contact: [email protected]
Official document
Index
Installation
选项 1(推荐): 下载并安装 Composer。
运行以下命令以安装 51Tracking PHP SDK
使用自动加载器导入 SDK 文件
选项 2:手动安装
- 下载或克隆此软件源到所需位置
- 在您的项目中引用此 SDK 的文件。最好使用绝对路径。
Testing
- 执行文件:
- 如果手动安装,请在浏览器上执行 "51tracking/51tracking-sdk-php/examples/testing.php"。
- 如果通过 composer 安装,请在浏览器上执行 "vendor/51tracking/51tracking-sdk-php/examples/testing.php"。
- 插入 51Tracking API 密钥。如何生成 51Tracking API 密钥
- 点击全部请求按钮或代表请求的按钮。
Error handling
只需添加一个 try-catch 块即可
Couriers
返回所有支持的快递公司列表
https://api.51Tracking.com/v4/couriers/all
Trackings
单个物流单号实时添加且查询
https://api.51Tracking.com/v4/trackings/create
获取多个物流单号的查询结果
https://api.51Tracking.com/v4/trackings/get
添加多个物流单号(一次调用最多创建 40 个物流单号)
https://api.51Tracking.com/v4/trackings/batch
根据ID更新物流信息
https://api.51Tracking.com/v4/trackings/update/{id}
通过ID删除单号
https://api.51Tracking.com/v4/trackings/delete/{id}
通过ID重新查询过期的单号
https://api.51Tracking.com/v4/trackings/retrack/{id}
Air Waybill
查询航空运单的结果
https://api.51Tracking.com/v4/awb
响应状态码
51Tracking 使用传统的HTTP状态码来表明 API 请求的状态。通常,2xx形式的状态码表示请求成功,4XX形式的状态码表请求发生错误(比如:必要参数缺失),5xx格式的状态码表示 51tracking 的服务器可能发生了问题。
Http CODE | META CODE | TYPE | MESSAGE |
---|---|---|---|
200 | 200 | 成功 |
请求响应成功。 |
400 | 400 | 错误请求 |
请求类型错误。请查看 API 文档以了解此 API 的请求类型。 |
400 | 4101 | 错误请求 |
物流单号已存在。 |
400 | 4102 | 错误请求 |
物流单号不存在。请先使用「Create接口」将单号添加至系统。 |
400 | 4103 | 错误请求 |
您已超出 API 调用的创建数量。每次创建的最大数量为 40 个快递单号。 |
400 | 4110 | 错误请求 |
物流单号(tracking_number) 不符合规则。 |
400 | 4111 | 错误请求 |
物流单号(tracking_number)为必填字段。 |
400 | 4112 | 错误请求 |
查询ID无效。 |
400 | 4113 | 错误请求 |
不允许重新查询。您只能重新查询过期的物流单号。 |
400 | 4120 | 错误请求 |
物流商简码(courier_code)的值无效。 |
400 | 4121 | 错误请求 |
无法识别物流商。 |
400 | 4122 | 错误请求 |
特殊物流商字段缺失或填写不符合规范。 |
400 | 4130 | 错误请求 |
请求参数的格式无效。 |
400 | 4160 | 错误请求 |
空运单号(awb_number)是必需的或有效的格式。 |
400 | 4161 | 错误请求 |
此空运航空不支持查询。 |
400 | 4165 | 错误请求 |
查询失败:未创建空运单号。 |
400 | 4166 | 错误请求 |
删除未创建的空运单号失败。 |
400 | 4167 | 错误请求 |
空运单号已存在,无需再次创建。 |
400 | 4190 | 错误请求 |
当前查询额度不足。 |
401 | 401 | 未经授权 |
身份验证失败或没有权限。请检查并确保您的 API 密钥正确无误。 |
403 | 403 | 禁止 |
禁止访问。请求被拒绝或不允许访问。 |
404 | 404 | 未找到 |
页面不存在。请检查并确保您的链接正确无误。 |
429 | 429 | 太多请求 |
超出 API 请求限制,请稍后重试。请查看 API 文档以了解此 API 的限制。 |
500 | 511 | 服务器错误 |
服务器错误。请联系我们: [email protected]。 |
500 | 512 | 服务器错误 |
服务器错误。请联系我们:[email protected]。 |
500 | 513 | 服务器错误 |
服务器错误。请联系我们: [email protected]。 |