PHP API Integration with Customer.io
"Good enough!"
$api = new Customerio\Api($siteId, $apiSecret, new Customerio\Request);
$response = $api->createCustomer(
'someid001',
'[email protected]',
array('arbitrary-data' => 'foobarbaz')
);
if( $response->success() )
{
// Continue on with life
} else {
// Learn from your mistakes
echo $response->message();
}
Create Customer:
createCustomer('someid001', '[email protected]', array('arbitrary-data' => 'foobarbaz'));
Update Customer:
updateCustomer('someid001', '[email protected]', array('arbitrary-data' => 'foobarbaz'));
Delete Customer:
deleteCustomer('someid001');
Fire Event:
fireEvent('someid001', 'event-name', array('arbitrary-value', 3.14));
All methods return a Response
object which contains the following methods:
success() // Boolean
message() // String