Skip to content

Instantly share code, notes, and snippets.

@rodolfobandeira
Created April 22, 2015 18:18
Show Gist options
  • Save rodolfobandeira/f645d53bbc4b13ae99e9 to your computer and use it in GitHub Desktop.
Save rodolfobandeira/f645d53bbc4b13ae99e9 to your computer and use it in GitHub Desktop.
Create a first event using Prediction.io
<?php
require_once("vendor/autoload.php");
use predictionio\EventClient;
$accessKey = 'YOUR_ACCESS_KEY';
$client = new EventClient($accessKey);
$response = $client->createEvent(array(
'event' => 'my_event',
'entityType' => 'user',
'entityId' => 'uid',
'properties' => array('prop1' => 1,
'prop2' => 'value2',
'prop3' => array(1,2,3),
'prop4' => true,
'prop5' => array('a','b','c'),
'prop6' => 4.56
),
'eventTime' => '2004-12-13T21:39:45.618-07:00'
));
?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment