Advertisement
Guest User

Untitled

a guest
May 24th, 2018
194
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.73 KB | None | 0 0
  1. <?php
  2.  
  3. // Example Without Factory
  4. $client = new hubspot\Http\Client(['key' => '5977bdcd-f966-493d-af93-9982ec46aafd']);
  5. $contacts = new hubspot\Resources\Contacts($client);
  6. $response = $contacts->all();
  7.  
  8. foreach ($response->contacts as $contact) {
  9. }
  10.  
  11. // ------- //
  12.  
  13. // Example With Factory
  14. $hubspot = hubspot\Factory::create('5977bdcd-f966-493d-af93-9982ec46aafd');
  15.  
  16. $new_contact = $hubspot->create([
  17.     'email' => 'testcontact@gmail.com',
  18.     'firstname' => 'Adrian',
  19.     'lastname' => 'Mott',
  20. ]);
  21.  
  22. $get_contact = $hubspot->contacts()->getByEmail("testcontact@gmail.com");
  23.  
  24. $get_all_contacts = $hubspot->contacts()->all([
  25.     'count'     => 10,
  26.     'property'  => ['firstname', 'lastname'],
  27.     'vidOffset' => 123456,
  28. ]);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement