Module: Thinkific

Defined in:
lib/thinkific.rb

Overview

Thinkific::Bundle bundle = Thinkific::Bundle.get( ‘id’ ) bundle.courses chapter = Thinkific::Chapter.get ‘id’ chapter.contents

category = Thinkific::Category.get ‘id’ categories = Thinkific::Category.all products = category.products products.delete

new_product = Thinkific::Product.create( :name => ‘prod name’ ) categories.add_product( new_product )

new_category = Thinkfic::Category.create :name => ‘cat name’, :description => ‘cat descr’, :slug => ‘cat slug’ new_category.update( :description => ‘cat descr 2’ ) new_category.delete

content = Thinkific::Content.get ‘id’

coupons = Thinkific::Coupon.all coupon = Thinkific::Coupon.get ‘id’ new_coupon = Thinkific::Coupon.create :code => ‘123’, :note => ‘c note’, :quantity => 5

users = Thinkific::User.all user = Thinkific::User.get ‘id’ new_user = Thinkific::User.create :first_name => ‘Adam’, :last_name => ‘Smith’ new_user.update :last_name => ‘Jackson’ new_user.delete

Defined Under Namespace

Classes: Course, User

Constant Summary collapse

DOMAIN =
'https://api.thinkific.com'

Class Method Summary collapse

Class Method Details

.headersObject



36
37
38
39
40
41
42
# File 'lib/thinkific.rb', line 36

def self.headers
  return {
    'Content-Type' => 'application/json',
    'X-Auth-Subdomain' => ::THINKIFIC_SUBDOMAIN,
    'X-Auth-API-Key' => ::THINKIFIC_KEY
  }
end

.queryObject



44
45
46
# File 'lib/thinkific.rb', line 44

def self.query
  return { :limit => 10000 }
end