PHP code example of koko-temp / koko-ai

1. Go to this page and download the library: Download koko-temp/koko-ai 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/ */

    

koko-temp / koko-ai example snippets




use Koko\Tracker;

$koko = new Tracker(['auth' => 'YOUR_AUTH_KEY']);

$classification = $koko->trackContent([
  'id' => '123',
  'user_id' => '123',
  'type' => 'post',
  'content_type' => 'text',
  'content' => ['text' => 'Some content']
]);

$koko->trackFlag([
  'id' => '123',
  'flagger_id' => '123',
  'reasons' => ['crisis'],
  'targets' => [['content_id' => '123']]
]);

$koko->trackModeration([
  'id' => '123',
  'moderator_id' => '123',
  'action' => 'user_warned',
  'target' => ['content_id' => '123']
]);