Skip to content

Convert RingCentral Message Store REST API Responses to XML Feeds

License

Notifications You must be signed in to change notification settings

ringcentral-ruby/ringcentral-rss-ruby

Repository files navigation

RingCentral RSS

Gem Version Build Status Coverage Status Dependency Status Codacy Badge Code Climate Scrutinizer Code Quality Downloads Docs License

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:

  1. Have a proxy feed that always retrieves the message-store API response and converts it to RSS
  2. Have a script that subscribes to the message-store eventFilter and publishes to a remote feed
  3. 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

  1. Fork it ( http://github.com/ringcentral-ruby/ringcentral-rss/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

License

RingCentral RSS is available under an MIT-style license. See LICENSE.md for details.

RingCentral RSS © 2016 by John Wang