Rightnow

Build Status

Ruby wrapper for the Oracle Rightnow Social API v2

Installation

Add this line to your application's Gemfile:

gem 'rightnow-client'

And then execute:

$ bundle

Or install it yourself as:

$ gem install rightnow-client

Usage

Instanciate a new client with your community url, API keys and API default user:

client = Rightnow::Client.new "http://community.company.com", :api_key => "YOUR_PUBLIC_KEY", :secret_key => "YOUR_PRIVATE_KEY", :user => "[email protected]"

The user specified here is a user of the community (usually a superadmin) which must have the permissions for all the actions you want to do with the client.

Then you can query the search API with:

res = client.search term: 'white', limit: 50

Get more details for one or more post:

client.post_get res.first
client.post_get ["fa8e6cc713", "fa8e6cb714"]

Fetch all comments for a post:

client.comment_list res.first
client.comment_list "fa8e6cc713"

Add a comment:

client.comment_add res.first, "Hello", as: '[email protected]'
client.comment_add "fa8e6cc713", "Hello", as: '[email protected]'

Edit a comment:

client.comment_update res.first, "Hello 2", as: '[email protected]'
client.comment_update "fa8e6cc713", "Hello 2", as: '[email protected]'

Delete a comment:

client.comment_delete 777, as: '[email protected]'

Get more details for one or more users:

client.user_get res.first.created_by.hash
client.user_get ["fa8e6cc713", "fa8e6cb714"]

Or any other generic request:

client.request 'UserList', :as => '[email protected]'

Debug

Instanciate the client with a :debug => true option to get debug info:

client = Rightnow::Client.new "http://community.company.com", ..., :debug => true

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