SevenShores\Hubspot\Resources\Contacts::create PHP Метод

create() публичный Метод

public create ( array $properties ) : Response
$properties array Array of contact properties.
Результат SevenShores\Hubspot\Http\Response
    function create($properties)
    {
        $endpoint = "https://api.hubapi.com/contacts/v1/contact";
        $options['json'] = ['properties' => $properties];
        return $this->client->request('post', $endpoint, $options);
    }

Usage Example

Пример #1
0
 /**
  * Creates a new contact with the HubSpotApi
  *
  * @return \SevenShores\Hubspot\Http\Response
  */
 private function createContact()
 {
     $contactsClient = new Contacts(new Client(['key' => 'demo']));
     $contactResponse = $contactsClient->create([['property' => 'email', 'value' => 'rw_test' . uniqid() . '@hubspot.com'], ['property' => 'firstname', 'value' => 'joe'], ['property' => 'lastname', 'value' => 'user']]);
     sleep(1);
     return $contactResponse;
 }
All Usage Examples Of SevenShores\Hubspot\Resources\Contacts::create