Advertisement
Guest User

Untitled

a guest
Jan 20th, 2017
105
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.96 KB | None | 0 0
  1. <?php
  2. ini_set('display_errors', 1);
  3. ini_set('display_startup_errors', 1);
  4. error_reporting(E_ALL);
  5.  
  6. session_start();
  7.  
  8. require('classes/cvent.class.php');
  9.  
  10. $account = 'PARTCA001';
  11. $username = 'PARTCA001Api';
  12. $password = 'S8COcsZJSwt';
  13. $prod = 'https://api.cvent.com/soap/V200611.ASMX?wsdl';
  14.  
  15. // login to API
  16. $client = new CventClient();
  17. $client->Login($account,$username,$password);
  18.  
  19. // get Updated Events Ids
  20. // $StartDate - is the date of last cron run, for testing return data for last 2 years
  21. $StartDate = date('Y-m-d', strtotime('-2 year')).'T00:00:00';
  22. $newEvents = $client->GetUpdated($StartDate);
  23. if(!empty($newEvents->GetUpdatedResult))
  24. {
  25.     // get all Event Ids's data
  26.     $eventIds = $newEvents->GetUpdatedResult;
  27.     $eventDatas = $client->GetEventById($eventIds->Id);
  28.     if(!empty($eventDatas->RetrieveResult->CvObject))
  29.     {
  30.         echo "<pre>";
  31.         var_dump($eventDatas->RetrieveResult->CvObject);
  32.         echo "</pre>";
  33.     }
  34. }
  35. else
  36. {
  37.     // nothing to update
  38. }
  39. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement