SiroDiaz / php-klaviyo-api

Low level but elegant Klaviyo full API wrapper for PHP with asynchronous track event support
https://packagist.org/packages/siro/php-klaviyo-api
MIT License
13 stars 7 forks source link

Adding a user #13

Closed LZL0 closed 4 years ago

LZL0 commented 4 years ago

I am getting 404 when I am attempting to add a new user.

Any help is appreciated.

$email = 'testemail@example.com';
$data = array('$email' => $email);

try {
    $klaviyo = new KlaviyoAPI(KLAVIYO_API_KEY);
    $response = $klaviyo->profile->edit('', $data);

    var_dump($response);
}
catch(Exception $e) {
    var_dump($e->getMessage());
}
LZL0 commented 4 years ago

Solved! It should be instead: $klaviyo->event->identify($data);