wistia-api

Ruby wrapper for Wistia's API

Installation

Required gems:

  • activeresource >= 2.3.8

  • configatron >= 2.6.4

Install:

gem install wistia-api

RDoc

Basic Usage

Start by requiring wistia:

require 'wistia'

Configure your API password:

Wistia.password = 'your-api-key-here'

You can get an API password by following the instructions here: wistia.com/doc/api-enable

Now you can use the Wistia::Media, Wistia::Project, and Wistia::Projects::Sharing classes as ActiveResource wrappers around Wistia's API.

See wistia.com/doc/data-api for more info.

Configuration Options

Set the format of the API:

Wistia.format = 'json'  # This is the default.
Wistia.format = 'xml'

Read configuration from an external YAML file:

Wistia.use_config!(path_to_yaml)

For an example YAML config, see spec/support/config.local.yml

Configure using a Hash:

Wistia.use_config!(:wistia => {
  :api => {
    :url => 'custom-api-url',
    :user => 'custom-api-user',
    :password => 'your-api-password',
    :format => 'xml-or-json'
  }
})

Examples

List all Media in your account:

Wistia::Media.find(:all)

List all Projects in your account:

Wistia::Project.find(:all)

List all Sharing objects for project 23:

Wistia::Projects::Sharing.find(:all, :params => { :project_id => 23 })

Copyright

Copyright © 2011 Wistia, Inc. See LICENSE.txt for further details.