Giter Club home page Giter Club logo

service_monster's Introduction

ServiceMonster

A Ruby wrapper for the Service Monster REST API.

Installation

Add this line to your application's Gemfile:

gem 'service_monster'

And then execute:

$ bundle

Or install it yourself as:

$ gem install service_monster

Usage

Configuration

Before you can make calls to ServiceMonster you must configure the library with a valid API Token. You can request a token be generated by ServiceMonster. The API Token ties the API request to a particualr ServiceMonster company id.

There are two ways to configure the ServiceMonster gem. You can pass a hash of configuration options when you create a client, or you can use a configure block.

client = ServiceMonster.client({api_key: "YOUR_KEY_HERE"})
ServiceMonster.configure do |config|
  config.api_key = "YOUR_KEY_HERE"
end

client = ServiceMonster.client

Parameters

ServiceMonster supports several parameters that can be passed to their API to change the results you receive.

  • q: Search term. Supply this parameter with a value to return results on which this search term matches at least one of the fields.
  • fields: Field list. Supply a comma separated list of fields you would like to be returned. See http://developer.servicemonster.net/Documentation.aspx?ID=1 for a list of resources and the available fields for each.
  • limit: The number of records to return in the result. Defaults to 10.
  • page: The page of data to return in the result. Defaults to the first page of data.

If you wish to filter a resource for a particular value in a field or set of dates use the following three parameters.

  • wField: A field name from the resource to filter on.
  • wOperator: An operator to use with the filter field. This can be one of:
    • gt
    • lt
    • eq
  • wValue: The value used to filter the wField with.

Contributing

  1. Fork it
  2. Create your feature branch (git checkout -b my-new-feature)
  3. Commit your changes (git commit -am 'Add some feature')
  4. Push to the branch (git push origin my-new-feature)
  5. Create new Pull Request

service_monster's People

Contributors

dlains avatar spiritbear avatar

Watchers

James Cloos avatar Darjan Vukusic avatar Ivan Toncev avatar Miloš Mihajlović avatar Igor Petkovic avatar Minja Davidović avatar Sava Vidakovic avatar  avatar Filip Pavić avatar Alex avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.