Nice Reply Client

This is a simple Ruby wrapper for the Nice Reply API.

Requirements

  • A Nice Reply Account
  • The account's private API key

Installation

Add this line to your application's Gemfile:

gem 'nice-reply-client'

And then execute:

$ bundle

Or install it yourself as:

$ gem install nice-reply-client

Usage

At the top of the class where you will be using Nice Reply Client, make sure to include this line


  require 'nice_reply_client'

Creating an instance of Nice Reply Client


  nice_reply_client = NiceReplyClient.new(
                        api_key: [Your Nice Reply Private API Key]
                      )

You can now call any method from Nice Reply's API. You do need to provide the method name in snake_case format. Please see below for examples.

After each call, the gem will return a hash including the response code and the response body from CDNetworks.

For a complete list of API calls, please see Nice Reply's API documentation

Examples

Getting your company's average ratings score:


  nice_reply_client.get_company_average
  => {:code=>"200", :body=>"{\"companyAverage\":9}"}

Getting your company's user list


  nice_reply_client.get_user_list

Getting an agent's average rating


  nice_reply_client.get_user_average(
    username: [Username to get average rating on]
  )

Getting a agent's average rating from last month


  nice_reply_client.get_user_average_last_month(
    username: [agent's username]
  )

Setting a rating


  nice_reply_client.set_rating(
    username: [agent's username],
    score: 10,
    from: [person leaving rating],
    ticket: "A123",
    comment: "Great service!"
  )

Updating a rating


  nice_reply_client.update_rating(
    id: [id # of rating to update],
    score: 7,
    comment: "OK service"
  )

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. Run specs with
    rake
  5. Push to the branch (git push origin my-new-feature)
  6. Create new Pull Request