Skip to content

Configuration

Madeline Dale edited this page Aug 5, 2020 · 8 revisions

Configuration

EDS API Profile

You'll need to have an EDS API profile in EBSCOadmin. You can request this at eds@ebscohost.com, or you can create a new EDS API profile yourself using the Profile Maintenance feature.

Be sure you add content to your EDS API profile (via the Databases tab) so it will return results.

Authentication

An EDS API session requires authentication. There are two methods available and both are configured in EBSCOadmin:

1. IP address

  • Use this if you plan to access the API from server(s) with a fixed IP address, or via a proxy server.
  • Create and manage IP address lists in the top-level Authentication tab at the top of the EBSCOadmin screen and select the IP Address sub-tab.

2. User ID and password

  • Use this if you might connect to the API from machines outside your network, or from many different addresses.
  • Create a user ID and password to access your API profile in the Authentication tab at the top of the EBSCOadmin screen. Make sure the Group associated with the login you create is the group that contains your EDS API profile.

EBSCO Support (eds@ebscohost.com) can help you set up an EDS API profile and get a userID and password for it if you are unfamiliar with EBSCOadmin.

Session

You can configure the EDS session in two ways:

1. Using environment variables

EDS_PROFILE=profile_name
EDS_GUEST=n
EDS_USER=your_user_id
EDS_PASS=secret
EDS_AUTH=ip
EDS_ORG=your_institution

Once set, you create a session like this:

session = EBSCO::EDS::Session.new

2. Using an options hash

session = EBSCO::EDS::Session.new({
      :profile =>'eds-api', :
      :user =>'your_user_id', 
      :pass =>'secret', 
      :guest => false, 
      :org => 'my organization'})

Default configuration options

Name Description Default Value
debug Produce debug messages & log connection traffic (see log below). Either true or false. false
log Log for connection traffic produced by faraday faraday.log
guest EDS guest mode. Either true or false false
org Your organization, company or institution. ''
auth Authentication method. Either 'user' or 'ip' user
auth_token Authentication token. ''
session_token Session token. ''
api_hosts_list Explicit list of API hosts. Can be used to limit to specific clusters. '['eds-api.ebscohost.com']'
uid_auth_url User ID authentication endpoint. /authservice/rest/uidauth
ip_auth_url IP authentication endpoint. /authservice/rest/ipauth
create_session_url Create session endpoint. /edsapi/rest/CreateSession
end_session_url End session endpoint. /edsapi/rest/EndSession
info_url Info endpoint. /edsapi/rest/Info
search_url Search endpoint. /edsapi/rest/Search
retrieve_url Retrieve record endpoint. /edsapi/rest/Retrieve
citation_exports_url Citation export endpoint. /edsapi/rest/ExportFormat
citation_exports_formats List of export formats to offer. all
citation_styles_url Citation styles endpoint. /edsapi/rest/CitationStyles
citation_styles_formats List of citation style formats to offer. all
user_agent User-Agent HTTP header. EBSCO EDS GEM v0.0.1
interface_id Application that you are performing user authentication for. edsapi_ruby_gem
max_attempts Maximum retries for failed EDS API requests. 2
max_results_per_page Maximum number of results to display per result page. 100
ebook_preferred_format Preferred ebook format. Either ebook-pdf or ebook-epub. ebook-pdf
use_cache Caches the EDS Auth token (for 30 mins) and the profile's Info (1 day). Either true or false. true
eds_cache_dir Directory to store the cache. ENV['TMPDIR'] or '/tmp'
smarttext_failover Will rerun a search using SmartText search mode if no results were found false

Note: any or all of these default configuration values can be changed:

1. Specify another value using the options hash:

session = EBSCO::EDS::Session.new({
      :debug => true,
      :log => 'eds-connection.log',
      :profile =>'eds-api', :
      :user =>'your_user_id', 
      :pass =>'secret', 
      :guest => false, 
      :org => 'my organization'})

2. Specify a configuration yaml file via :config:

session = EBSCO::EDS::Session.new({
      :config => eds-config.yaml,
      :profile =>'eds-api', :
      :user =>'your_user_id', 
      :pass =>'secret', 
      :guest => false, 
      :org => 'my organization'})