Ruby library to create XML syndication feeds for RingCentral message-store
REST API responses.
This library was originally created in response to a question on archiving RingCentral SMS data using Smarsh via a RSS feed.
Installation
gem install ringcentral-rss
While ringcentral_sdk
isn't strictly required for this SDK, it does build feeds based on the Faraday::Response
objects returned by the SDK.
Usage
require 'ringcentral-rss'
require 'ringcentral_sdk'
client = RingCentralSdk.new [...]
client.authorize [...]
res = client.http.get do |req|
req.url 'account/~/extension/~/message-store'
req.params['direction'] = 'Outbound'
req.params['messageType'] = 'SMS'
end
rc_feed = RingCentral::RSS::AtomFeed.new res
xml = rc_feed.to_xml
xml = RingCentral::RSS::AtomFeed.new(res).to_xml
Demo Scripts
Demo scripts are located in the scripts
directory of the GitHub repo. The following demos are included:
- CLI script to retrieve
message-store
endpoint and print out XML - Sinatra web service to display XML proof of concept for protected services (no included auth)
Background
The genesis of this is the requirement to have RingCentral SMS messages available via a RSS feed. There are 3 ways to accomplish this:
- Have a proxy feed that always retrieves the
message-store
API response and converts it to RSS - Have a script that subscribes to the
message-store
eventFilter and publishes to a remote feed - Have a script that polls the
message-store
API and publishes to a remote feed
The library code will convert RingCentral message-store API response and message objects into an XML feed. The included Sinatra web service will host this as a proxy feed (option #1 above).
Change Log
See CHANGELOG.md
Links
Project Repo
RingCentral API Docs
RingCentral Official SDKs
Contributing
- Fork it ( http://github.com/ringcentral-ruby/ringcentral-rss/fork )
- Create your feature branch (
git checkout -b my-new-feature
) - Commit your changes (
git commit -am 'Add some feature'
) - Push to the branch (
git push origin my-new-feature
) - Create new Pull Request
License
RingCentral RSS is available under an MIT-style license. See LICENSE.md for details.
RingCentral RSS © 2016 by John Wang