Create a batch using a zip file using PHP

  1. <?php
  2. require_once("sendsms_api.php");
  3. $api new SendsmsApi();
  4. $api->setUsername("demouser");
  5. $api->setPassword("demouser");
  6.  
  7. $file "../generic/mybatch.zip";
  8.  
  9. $result $api->batch_create("My batch name"$file0false'zip');
  10.  
  11. if($api->ok($result)) {
  12.     /* Batch created ! */
  13.     
  14.     $batch_id $result['details'];
  15.     
  16.     echo "Batch created with ID {$batch_id}\n";
  17.     
  18. }
  19.  
  20. ?>