-
-
Notifications
You must be signed in to change notification settings - Fork 35
Expand file tree
/
Copy pathgetPackages.php
More file actions
32 lines (22 loc) · 739 Bytes
/
getPackages.php
File metadata and controls
32 lines (22 loc) · 739 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
<?php
require __DIR__.'/vendor/autoload.php';
use Salamek\PplMyApi\Api;
/**
* Returns package/s info from ppl filtered by $customRefs, $dateFrom, $dateTo, $packageNumbers useful for tracking and checking status of package/s
*/
$username = 'my_api_username';
$password = 'my_api_password';
$customerId = 'my_api_customer_id';
$pplMyApi = new Api($username, $password, $customerId);
$customRefs = null;
$dateFrom = new \DateTime();
$dateFrom->modify('-2 days'); //From 2 days ago
$dateTo = new \DateTime(); // To NOW
$packageNumbers = []; // Specify array of package numbers to check
$result = $pplMyApi->getPackages(
$customRefs = null,
$dateFrom,
$dateTo,
$packageNumbers
);
print_r($result);