PHP code example of bananastandio / php_sdk

1. Go to this page and download the library: Download bananastandio/php_sdk library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

bananastandio / php_sdk example snippets




use Banana\Client;
use Banana\Models\Event;

$client = new Client("*your public key*", "* your secret key *"); // Replace with your keys

$events = $client->events(); // Get the first page of events (default sorting is most recently updated first)
foreach ($events as $event) {
    echo $event->id . "|" . $event->visitor_id . "\n";
}

$event->delete();

$event = Event::find($client, $events[0]->id);
echo "Found: " . $event->id . "|" . $event->visitor_id . "\n";

$html = $client->getProductPageHtml($event->product_id);

$client->pushViewEvent($event->product_id, null, 123);