PHP code example of luannsr12 / sdkcorreios

1. Go to this page and download the library: Download luannsr12/sdkcorreios 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/ */

    

luannsr12 / sdkcorreios example snippets


  

   rreios\Config\Services;
   use Sdkcorreios\Methods\Tracking;

   // Confira na tabela os IDs dos serviços
   Services::setServiceTracking('0001'); // ID do site de busca
   Services::setDebug(true);

   $tracking = new Tracking();
   $tracking->setCode("OBJETO1");
   $tracking->setCode("OBJETO2");

   // OR
   // $tracking->setCode("OBJETO1,OBJETO2");
   
   if(Services::$success){
      echo json_encode($tracking->get());
   }else{
      var_dump(Services::getMessageError()); 
   }





  correios\Config\Services;

  $services = Services::getServices();

  print_r($services);