Ruby Zendesk API wrapper
Ruby
Switch branches/tags
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
lib
script
test
.autotest
Gemfile
Gemfile.lock
README.md

README.md

Zapi

A Ruby wrapper for the Zendesk REST API.

This is a work in-progress. Not all elements in the README are completed.

Installation

Add zapi to your Gemfile:

gem "zapi", "~> x.x.x"

Then require zapi with the rest of the gems you use:

require "zapi"

Setup

To get started, you need to configure zapi with your API authentication information. You can do that as follows:

# User/Pass Configuration
Zapi.configure do |config|
  config.username    = "waldo@domain.com"
  config.password    = "supersecure"
  config.domain      = "domain.zendesk.com"
  config.ssl         = true
  config.api_version = 1
end

# User/Token Configuration
Zapi.configure do |config|
  config.username    = "waldo@domain.com/token"
  config.token       = "your-really-long-token-goes-here"
  config.domain      = "domain.zendesk.com"
  config.ssl         = true
  config.api_version = 1
end

# User/Token/Custom Domain Configuration
Zapi.configure do |config|
  config.username    = "waldo/token"
  config.token       = "your-really-long-token-goes-here"
  config.domain      = "your.custom.domain.com"
  config.ssl         = true
  config.api_version = 1
end

Usage

Organizations

Interacting with existing organizations:

orgs = Zapi.organizations.all

orgs.each do |o|
  puts o.name, o.default

  o.users.each do |u|
    puts u.name, u.email
  end
end

Creating new organizations:

# returns the org if it was created or false if the request failed
org = Zapi.organization.new(
        :name => "Acme Corp",
        :default => "acmecorp.com",
        :is_shared => false
      )

Searching for organizations:

orgs = Zapi.organizations.find(
         :name => "acme.com",
         :created => ">2012/02/20",
       )