https://github.com/ringcentral/engage-digital-communities-ruby
Ruby Client for Engage Communities API
https://github.com/ringcentral/engage-digital-communities-ruby
Last synced: 12 months ago
JSON representation
Ruby Client for Engage Communities API
- Host: GitHub
- URL: https://github.com/ringcentral/engage-digital-communities-ruby
- Owner: ringcentral
- License: mit
- Created: 2014-10-28T13:50:02.000Z (over 11 years ago)
- Default Branch: master
- Last Pushed: 2022-02-18T10:01:34.000Z (over 4 years ago)
- Last Synced: 2025-04-07T20:43:16.646Z (about 1 year ago)
- Language: Ruby
- Homepage:
- Size: 147 KB
- Stars: 3
- Watchers: 15
- Forks: 5
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE.txt
Awesome Lists containing this project
README
# RingCentral Engage Communities Ruby API Client
[](https://github.com/ringcentral/engage-digital-communities-ruby/actions)
RubyClient for the Engage Communities.
This client support most of Engage Communities resources, can read and write them, paginates with cursor like interface, supports attachments and supports proper validation and error format.
This is heavily used internally at Engage Communities.
# Compatibility
Compatible and tested with:
- Ruby MRI 2.6, 2.7, 3.0 and HEAD
- ActiveSupport 4+, 5+, 6+, Head
## Installation
Gemfile:
```ruby
gem 'dimelo_ccp_api'
```
## Usage
```ruby
require 'dimelo_ccp_api'
users_client = Dimelo::CCP::API::Client.new('https://domain-test.api.users.dimelo.com/1.0', 'access_token' => ENV['DIMELO_API_KEY'])
answers_client = Dimelo::CCP::API::Client.new('https://domain-test.api.answers.dimelo.com/1.0', 'access_token' => ENV['DIMELO_API_KEY'])
feedbacks_client = Dimelo::CCP::API::Client.new('https://domain-test.api.ideas.dimelo.com/1.0', 'access_token' => ENV['DIMELO_API_KEY'])
user = Dimelo::CCP::User.find(1, users_client)
questions = user.questions(answers_client)
puts "question count: #{questions.count}"
questions.each do |question, i|
answers = question.answers
puts "#{i} of #{questions.count} => answer count: #{answers.count}"
answers.each do |answer|
answer.question_flow_state = "lol"
end
end
feedbacks = Dimelo::CCP::Feedback.find({ :order => 'updated_at.desc' }, feedbacks_client)
puts "feedbacks count: #{feedbacks.count}"
puts "feedbacks not by anonymous and superadmin: #{feedbacks.select{|f| f.user_id.present?}.count}"
```
## Contributing
1. Fork it ( http://github.com/ringcentral/engage-digital-communities-ruby/fork )
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