PHP code example of tcdev / thinkific-php

1. Go to this page and download the library: Download tcdev/thinkific-php 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/ */

    

tcdev / thinkific-php example snippets


$think = new \Thinkific\Thinkific ( [
   'apikey'    => 'your-api-key',
   'subdomain' => 'yoursubdomain',
   'debug'     => true
   ] );

// Create interface to access Users endpoint
$users = $think->users();

// Create interface to access Bundles endpoint
$bundles = $think->bundles();
// etc, etc

// Get all users
$users = $users->getAll();

// Get a specific user
$users->getById(1234);

// Add a user
$users->add([
    "first_name" => "John",
    "last_name" => "Doe",
    "email"=>"[email protected]",
    "roles"=>[]
  ]);

// Update a user
$users->update( 1234, [
    "first_name" => "John",
    "last_name" => "Doe",
    "email"=>"[email protected]",
    "roles"=>[]
  ]);

// Delete a user
$users->delete( 1234);
json
{
   "liotboney/thinkific-php": "dev-master"
   }
}
shell
composer