Omniata PHP SDK uses the
curl_exec method to send events to the Omniata Event API, and request content by calling Omniata Channel API.
The latest available SDK can be found below:
|1.0.0||6 Feb 2016|
To install the Omniata PHP SDK unzip the package to the project folder.
To update to the latest version remove the directory Omniata from your project repository. Replace with the Omniata folder inside of the new package.
There is a example project in the package which is entirely optional to include.
Once the Omniata PHP SDK has been included in your PHP application, you can start using it. First, you need to include the library in the PHP application.
// Include the two files in the PHP app require_once(dirname(__FILE__) . "/../Omniata/Client.php"); require_once(dirname(__FILE__) . "/../Omniata/OmniataUrl.php");
Then in the file, initiate the library with declaration of a new
$api_key = "<API_KEY>"; $uid = "<UID>"; $org = "<ORG_NAME>"; $client = new Client($api_key, $uid, $org);
There are no default methods to send events in the PHP SDK. All events are coded individually. To track events, define the parameters in an array.
$eventPara = array( "om_event_type" => "", "level" => "level 4", ); $client->track($eventPara);
To get channel message or content, call the method below with the channel ID.
$channel_id = "40"; $content=$client->deliver($channel_id);