/** * Creates an associated contact for a new company with the HubSpotApi * * @param int $companyId The id of the company where to create the new contact. * * @return array */ private function createAssociatedContact($companyId) { $newContactResponse = $this->createContact(); $contactId = $newContactResponse['vid']; $response = $this->companies->addContact($contactId, $companyId); sleep(1); return [$contactId, $response]; }
/** * @return int */ private function createCompany() { $companies = new Companies(new Client(['key' => 'demo'])); return $companies->create(['name' => 'name', 'value' => 'dl_test_company' . uniqid()])->companyId; }