Home > Back-end >  Getting Values Using API and Laravel
Getting Values Using API and Laravel

Time:01-08

I make my first project with API. I need add this to my project: https://dokumentacja-inpost.atlassian.net/wiki/spaces/PL/pages/18153479/1.7.3 Shipment Tracking

I use in my project Laravel 8.

I make composer require michalbiarda/shipx-php-sdk

And I added this code to my controller"

$status = new \MB\ShipXSDK\Method\Tracking\Read;
$status->tracking_number = 123;
dd($status);

but its return:

MB\ShipXSDK\Method\Tracking\Read {#1599 ▼
   "tracking_number": 123
}

Not status :(

How can I get status from inputs by this API?

Please help me

CodePudding user response:

Probably you need to hit a curl request with required attributes. Screen shot of the following curl

You can dd() the response of the curl response and surely you ll get the status.

CodePudding user response:

I think you initialize the wrong object. the right object for tracking is "\MB\ShipXSDK\Model\Tracking" now you can get status value.

in any situation, you have to integrate it step by step. please follow SDKs Github document

  •  Tags:  
  • Related