1. Go to this page and download the library: Download track123/open-api library. Choose the download type require.
2. Extract the ZIP file and open the index.php.
3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
track123 / open-api example snippets
use Track123\OpenApi\Config;
$config = new Config('your-access-token'); // 替换为你的 token
use Track123\OpenApi\System\Request\OceanCargo\GetOceanCargoTrackingsRequest;
use Track123\OpenApi\Track123;
$request = new GetOceanCargoTrackingsRequest();
$request->setTracking('order123', 'ONEYSZPF55508400', 2); // bill of lading
//或批量添加
//$request->setTrackings($trackings);
$response = Track123::system($config)->getOceanCargoTrackings($request);
print_r($response->getAcceptedData());
if ($response->hasRejectedData()) {
echo $response->getRejectedMessages();
}
Loading please wait ...
Before you can download the PHP files, the dependencies should be resolved. This can take some minutes. Please be patient.