Project

sfkb

0.0
No commit activity in last 3 years
No release in over 3 years
A Ruby library (based on Restforce) for working with the Salesforce Knowledge Base.
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Development

~> 1.16
~> 10.0
~> 0.0.4
~> 5.11
~> 0.11
~> 0.8
~> 12.3
~> 0.15
~> 4.0

Runtime

~> 2.2
~> 0.12
~> 2.5
 Project Readme

SFKB

SalesForce Knowledge Base

A Ruby library that extends Restforce to provide convenient access to Articles and ArticlesVersions in the Salesforce Knowledge Base.

Build Status Test Coverage Maintainability Dependency Status Gem Version License

Requirements

Installation

gem install sfkb

Usage

Include it in your project, for example in your Gemfile

gem 'sfkb'

or just require it.

Now you can use the module as a client, or do something fancier by instantiating a SFKB::Client.

For example, here's how to print the titles of the master versions of the first 10 documents:

require 'sfkb'
SFKB.new.articles.take(10).each { |a| puts a.OnlineMasterVersion.data.Title }

Here's how to list the titles of every translation of every draft article:

sf = SFKB.new
sf.articles.select(:hasTranslations?) do |a|
    sf.translations(a, 'Draft').each do |t|
        puts t.data.Title
    end
end

Documentation is available here.

You will need to register an app in your Salesforce instance so you can obtain your SALESFORCE_CLIENT_ID and SALESFORCE_CLIENT_SECRET (see below).

Contributing

Bug reports and pull requests are welcome on GitHub at https://github.com/bjjb/sfkb. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the Contributor Covenant code of conduct.

Testing

When testing, you'll want to preconfigure your environment with these settings:

  • SALESFORCE_CLIENT_ID
  • SALESFORCE_CLIENT_SECRET

You might also want to set the following (which defaults to 'login.salesforce.com) to something like 'company.my.salesforce.com', or 'test.salesforce.com' if you want to use a sandbox.

  • SALESFORCE_HOST

For authentication, you may either use the username/password/token-secret combination:

  • SALESFORCE_USERNAME
  • SALESFORCE_PASSWORD
  • SALESFORCE_SECURITY_TOKEN

or

  • SALESFORCE_OAUTH_TOKEN
  • SALESFORCE_REFRESH_TOKEN

the latter of which is optional, and can (and probably should) be set using the authentication_callback. For more details, see Restforce.

License

The gem is available as open source under the terms of the MIT License.

Code of Conduct

Everyone interacting in the Glinga project’s codebases, issue trackers, chat rooms and mailing lists is expected to follow the code of conduct.