Skip to content

Get tracking number in response #7

@Sylvesterx1

Description

@Sylvesterx1

We use this function for save shipping label.

$shipmentData = json_decode($response->getBody()->__toString(), true);

while ($shipmentData['status'] !== 'confirmed') {
    sleep(1);
    $response = $api->shipments()->get($shipmentData['id']);
    $shipmentData = json_decode($response->getBody()->__toString(), true);
}

$labelResponse = $api->shipments()->label()->get($shipmentData['id'], [
    'format' => 'Pdf',
    'type' => 'A6',
]);

file_put_contents('var/labels/paczkomaty_label.pdf', $labelResponse->getBody()->__toString());
  1. It is possible get help with display /get tracking number in response directly after creating the shipment / save shipping label?

  2. with this function I can get all shippments:

$response2 = $api->organizations()->shipments()->get('2773');
$response3 = json_decode($response2->getBody()->__toString(), true);

var_dump($response3);

the same way I try get status shipping tracking history:

$response2 = $api->tracking()->serviceHistory()->get('620583199331612012919687');
$response3 = json_decode($response2->getBody()->__toString(), true);

var_dump($response3);

but in response I get:
array(4) { ["timestamp"]=> string(23) "Jan 9, 2023, 6:33:35 PM" ["status"]=> int(404) ["error"]=> string(9) "Not Found" ["path"]=> string(50) "/tracking/620583199331612012919687/service_history" }

Also I try track live shipping and also return not found.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions