Skip to content

PHP SDK for interacting with the Thinkific LMS Api

License

Notifications You must be signed in to change notification settings

himalayan-institute/thinkific-php

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

36 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Thinkific PHP SDK

Dependency Status

This is under heavy construction and in early alpha stages. It is an sdk to help interact with the Thinkific LMS API. The documentation for that REST Api can be found here.

Installation

Bleeding Edge

During your development, you can keep up with the latest changes on the master branch by setting the version requirement for thinkific-api to dev-master

{
   "require": {
      "elliotboney/thinkific-php": "dev-master"
   }
}

Via command line:

composer require elliotboney/thinkific-php

Usage

Create a client for interacting with the API:

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

Endpoints

You can reach the following endpoints:

  • Bundles
  • Collections
  • Coupons
  • Course reviews
  • Courses
  • Enrollments
  • Orders
  • Products
  • Promotions
  • Users

by using the following scheme:

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

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

Methods

The classes have the basic requests for GET, PUT, POST, DELETE with the Id parameter as well a getAll. If the endpoint doesn't support the call, an ApiException() will be thrown. Some examples of accessing these endpoints:

// 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);

For more details of which endpoints support which, please make sure you look through the Thinkific API Docs.

About

PHP SDK for interacting with the Thinkific LMS Api

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • PHP 100.0%