userscape / customerio
PHP API for Customer.io
Installs: 730 134
Dependents: 2
Suggesters: 0
Security: 0
Stars: 33
Watchers: 9
Forks: 16
Open Issues: 1
Requires
- guzzlehttp/guzzle: 6.*|7.*
Requires (Dev)
- phpunit/phpunit: 5.5.*
This package is not auto-updated.
Last update: 2024-11-15 23:20:26 UTC
README
PHP API Integration with Customer.io
"Good enough!"
Usage
$api = new Customerio\Api($siteId, $apiSecret, new Customerio\Request); $response = $api->createCustomer( 'someid001', 'some@email.com', array('arbitrary-data' => 'foobarbaz') ); if ($response->success()) { // Continue on with life } else { // Learn from your mistakes echo $response->message(); }
API Methods
Create Customer:
createCustomer('someid001', 'some@email.com', array('arbitrary-data' => 'foobarbaz'));
Update Customer:
updateCustomer('someid001', 'some@email.com', array('arbitrary-data' => 'foobarbaz'));
Delete Customer:
deleteCustomer('someid001');
Fire Event:
fireEvent('someid001', 'event-name', array('arbitrary-value' => 3.14));
Fire Historical Event:
fireEvent('someid001', 'event-name', array('arbitrary-value' => 3.14), 1420070400);
Fire Anonymous Event: (http://customer.io/docs/invitation-emails.html)
fireAnonymousEvent('event-name', array('arbitrary-value' => 3.14));
Record Pageview:
recordPageview('someid001', 'https://www.full-pageview-url.com/', 'https://www.optional-full-referrer-url.com/');
Response Object
All methods return a Response
object which contains the following methods:
success() // Boolean
message() // String