<commit_before>PHP API wrapper for the eventsforce API
======

A basic PHP wrapper for the eventsforce API methods, providing methods to POST and GET results
For reference to what kind of data you can pass to the API methods refer to the general [API documentation](http://docs.eventsforce.apiary.io/#reference).


Usage - General
------

``` php
//Require the class wrapper
require_once 'events_force_api_wrapper.php';

//create standard instance of Events force wrapper class
$ef = new EFAuth(array(
    'key' => '035E0A65508A4D8FAB63A983F36ACCAC', // non blanked key
    'client' => 'apiexample' // client slug
));

//Then you are ready to call methods such as:
$ef->get_events();
$ef->get_event(2);
$ef->authenticate(2, '<EMAIL>', 'ad<PASSWORD>');

//and so on
```


Usage - more specific
------

Another way to use the class is to pass in an event id initially when you instantiate it as below.

``` php
$ef = new EFAuth(array(
    'key' => '035E0A65508A4D8FAB63A983F36ACCAC', // non blanked key
    'client' => 'apiexample' // client slug
    'eventid' => 2
));

//this allows you to then call methods without passing in an eventID, as you are using a 'default' eventID as standard, you can still pass in an eventID which will override the default for that particular method

```



Available methods
------

### Event Methods
---


#### Get Events
This doesn't take any parameters and will all the events for the client slug passed in when the class was instantiated<commit_msg>Starting to rewrite readme<commit_after>PHP API wrapper for the Events Force API
======

An API client package for the Events Force API.
For reference to what kind of data you can pass to the API methods refer to the general [API documentation](http://docs.eventsforce.apiary.io/#reference).
To get a client slug / client account string see [here](http://docs.eventsforce.apiary.io/#introduction/url)

Requirements
------

* PHP >= 5.5.0
* [Guzzle](https://github.com/guzzle/guzzle)


Usage - General
------

Note: The follow examples all use the apiexample credentials as shown [here](http://docs.eventsforce.apiary.io/#introduction/example-data)

```php

// Define a new client, passing in the client slug and api key
$client = new \EventsForce\Client('apiexample', '035E0A65508A4D8FAB63A983F36ACCAC');

```

Now you are ready to use specific resources and methods
The resources are split as shown on the [api docs](http://docs.eventsforce.apiary.io/#introduction/url)
E.g to access [events get all](http://docs.eventsforce.apiary.io/#reference/events/eventsjson/get) you would do the following:

```php

$json = $client->events->getAll();=

```


Usage - more specific
------

Another way to use the class is to pass in an event id initially when you instantiate it as below.

``` php
$ef = new EFAuth(array(
    'key' => '035E0A65508A4D8FAB63A983F36ACCAC', // non blanked key
    'client' => 'apiexample' // client slug
    'eventid' => 2
));

//this allows you to then call methods without passing in an eventID, as you are using a 'default' eventID as standard, you can still pass in an eventID which will override the default for that particular method

```



Available methods
------

### Event Methods
---


#### Get Events
This doesn't take any parameters and will all the events for the client slug passed in when the class was instantiated
{'fraction_non_alphanumeric': 0.11387473778843273, 'fraction_numerical': 0.023673958645489962, 'mean_word_length': 3.8801169590643276, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 19, 'https://': 1, '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': '5020982', 'n_tokens_mistral': 1062, 'n_tokens_neox': 974, 'n_words': 411}