Skip to content
/ API Public
forked from osulp/API

A rails api application for interfacing with alma

Notifications You must be signed in to change notification settings

zhang4952/API

This branch is 56 commits behind osulp/API:master.

Folders and files

NameName
Last commit message
Last commit date

Latest commit

123fd08 · Aug 17, 2021
Aug 16, 2021
Jan 21, 2020
Aug 13, 2021
Aug 13, 2021
Jun 11, 2018
Jun 11, 2018
Jun 11, 2018
Jun 11, 2018
Jan 11, 2020
Jun 11, 2018
Jun 11, 2018
Jun 11, 2018
Nov 5, 2018
Jun 12, 2018
Jun 11, 2018
Aug 12, 2021
Jun 19, 2018
Aug 12, 2021
Aug 13, 2021
Aug 13, 2021
Jul 2, 2018
Jun 11, 2018
Aug 12, 2021
Jun 11, 2018
Jun 11, 2018
Jun 15, 2018

Repository files navigation

API

This application is a Rails API application that serves up information to those who wish to use it. Currently this application only supports querying Library Hours that are Managed in Alma.

Setup (Docker)

This application uses docker. To set up the application, simply run docker-compose build && docker-compose up

Setup (Puma/Rails)

This application uses: Ruby Version 2.5.1

First run bundle install then run rails s

Querying the API

To query the API, make a POST request to api.library.oregonstate.edu

Hours

To query the HOURS, follow the steps from "Querying the API" to the route /hours.json The API can accept no data and it will query for the current day. The API can accept a single date ["2018-07-18"] and it will return the hours for that date. The API can accept an array of dates ["2018-07-18", "2018-07-22"] and it will return the hours from the first date to the last date.

Return value

The API will return a JSON object which looks like:

{ open: "12:00am",
  close: "12:00am",
  string_date: "Fri, Jun 12, 2018",
  sortable_date: "2018-06-12",
  formatted_hours: "Open all day",
  open_all_day: true,
  closes_at_night: false,
  event_desc: "",
  event_status: ""
}

event_desc is the description of any special events found for a date or range of dates given. event_status describes whether or not the library is open or closed

the key to this JSON Object is 2018-06-12T00:00:00+00:00

About

A rails api application for interfacing with alma

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Ruby 94.7%
  • HTML 4.2%
  • Other 1.1%