0.0
No commit activity in last 3 years
No release in over 3 years
There's a lot of open issues
A simple library for communicating with the TeamSupport API. Currently supports Customers, Products, and Tickets, with plans to expand to full support of the API with a 1.0 release.
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Development

~> 1.0

Runtime

~> 0.0.11
~> 2.0
~> 1.0
 Project Readme

The Teamsupport Ruby Gem

Gem Version Build Status Dependency Status Code Climate Coverage Status Inline docs

A Ruby interface to the Teamsupport API.

Installation

gem install teamsupport

Documentation

http://rdoc.info/gems/teamsupport

To access custom fields you will need to use the attrs method along with the api field name:

customer = client.customer(213747670)
customer.attrs[:CustomField1]

Caveat: The TeamSupport API currently returns boolean values as "True"/"False" strings. A workaround has been applied to the teamsupport gem that will return a boolean true/false for any of the standard TeamSupport values that should be a boolean (ie. IsActive on customers and IsClosed on tickets). Any additional custom fields that were created in TeamSupport will return the "True"/"False" string value instead of the proper boolean.

Examples

https://github.com/jrbeilke/teamsupport/tree/master/examples

Configuration

The Teamsupport API requires you to authenticate via Basic Auth, using an Organization ID (aka API Key) and an API Token (aka API Secret).

You'll need to configure these values before you make a request or else you'll get the error:

Bad Authentication data

You can pass configuration options as a block to Teamsupport::REST::Client.new.

client = Teamsupport::REST::Client.new do |config|
  config.api_key    = "TEAMSUPPORT_ORGANIZATION_ID"
  config.api_secret = "TEAMSUPPORT_API_TOKEN"
  config.api_url = "TEAMSUPPORT_API_URL"
end

The API url is not required and will default to https://app.teamsupport.com if not defined in config.

Usage Examples

After configuring a client, you can do the following things.

Fetch a single customer (by organization ID)

client.customer(213747670)

Fetch a list of customers with details (by organization ID, or by implicit authenticated parent organization)

client.customers

Fetch a single product (by product ID)

client.product(213747670)

Fetch a list of products with details (by product ID, or by implicit authenticated parent organization)

client.products

Fetch a list of products for a customer (by customer ID)

client.customer_products(213747670)

Fetch a single ticket (by ticket ID, or by ticket Number)

client.ticket(213747670)

Fetch a list of tickets with details (by ticket ID, or by implicit authenticated parent organization)

client.tickets

Fetch a list of tickets for a customer (by customer ID)

client.customer_tickets(213747670)

Object Graph

Entity-relationship diagram

This entity-relationship diagram is generated programatically. If you add or remove any Teamsupport objects, please regenerate the ERD with the following command:

bundle exec rake erd

Supported Ruby Versions

This library aims to support and is tested against the following Ruby versions:

  • Ruby 2.0.0
  • Ruby 2.1
  • Ruby 2.2
  • JRuby 9.1.1.0

Copyright

Copyright (c) 2016 Jon Beilke. See LICENSE for details.