Navigation Menu

Skip to content

ylecuyer/rightnow

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

30 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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 => "api@dimelo.com"

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: 'user@email.com'
client.comment_add "fa8e6cc713", "Hello", as: 'user@email.com'

Edit a comment:

client.comment_update res.first, "Hello 2", as: 'user@email.com'
client.comment_update "fa8e6cc713", "Hello 2", as: 'user@email.com'

Delete a comment:

client.comment_delete 777, as: 'author@email.com'

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 => 'admin@domain.com'

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

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Contributors 4

  •  
  •  
  •  
  •  

Languages