<commit_before>php-customerio
==============

PHP API Integration with Customer.io

> "Good enough!"

[![Build Status](https://travis-ci.org/UserScape/php-customerio.svg?branch=master)](https://travis-ci.org/UserScape/php-customerio)

## Usage

```php
$api = new Customerio\Api($siteId, $apiSecret, new Customerio\Request);

$response = $api->createCustomer(
    'someid001',
    '<EMAIL>',
    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', '<EMAIL>', array('arbitrary-data' => 'foobarbaz'));

Update Customer:

    updateCustomer('someid001', '<EMAIL>', array('arbitrary-data' => 'foobarbaz'));

Delete Customer:

    deleteCustomer('someid001');


Fire Event:

    fireEvent('someid001', 'event-name' array('arbitrary-value', 3.14));

## Response Object

All methods return a `Response` object which contains the following methods:

    success() // Boolean

    message() // String<commit_msg>fix a comma in readme.md<commit_after>php-customerio
==============

PHP API Integration with Customer.io

> "Good enough!"

[![Build Status](https://travis-ci.org/UserScape/php-customerio.svg?branch=master)](https://travis-ci.org/UserScape/php-customerio)

## Usage

```php
$api = new Customerio\Api($siteId, $apiSecret, new Customerio\Request);

$response = $api->createCustomer(
    'someid001',
    '<EMAIL>',
    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', '<EMAIL>', array('arbitrary-data' => 'foobarbaz'));

Update Customer:

    updateCustomer('someid001', '<EMAIL>', array('arbitrary-data' => 'foobarbaz'));

Delete Customer:

    deleteCustomer('someid001');


Fire Event:

    fireEvent('someid001', 'event-name', array('arbitrary-value', 3.14));

## Response Object

All methods return a `Response` object which contains the following methods:

    success() // Boolean

    message() // String
{'fraction_non_alphanumeric': 0.17876588021778583, 'fraction_numerical': 0.016333938294010888, 'mean_word_length': 4.378048780487805, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 23, 'https://': 4, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3152452', 'n_tokens_mistral': 751, 'n_tokens_neox': 693, 'n_words': 157}