Skip to content

jeffjose/whartonapi

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

42 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

whartonapi

An API (python, javascript) to interact with Wharton Webservices.

Python

Authentication - auth.py

auth(username, password)
>>> auth(username, password)
get_token(username, password)
>>> get_token(username, password)
ABCDEFGHIJK123456

Group Study Rooms - gsr.py

get_locations(token)
>>> get_locations(token)
[u'JMHH F', u'JMHH G', u'JMHH 2', u'JMHH 3', u'2401']
get_reservations(token)
>>> get_reservations(token)
[
  {
    u'duration': 30, 
    u'reservationId': 1536217, 
    u'roomId': u'2401 813', 
    u'subjectLine': u'GSR Reservation', 
    u'startTime': datetime.datetime(2015, 11, 17, 10, 0)
   }
]
create_reservations(token)
>>> data = [{
    u'duration': 30, 
    u'roomId': u'2401 813', 
    u'subjectLine': u'GSR Reservation', 
    u'startTime': datetime.datetime(2015, 11, 17, 11, 0)
   }]
>>> create_reservations(token, data)
>>>
delete_reservations(token)
>>> reservation_ids = ['1536217']
>>> create_reservations(token, reservation_ids)
>>>

Javascript

Install

npm install whartonapi

Use

var whartonapi = require('whartonapi');

Authentication

whartonapi.auth('myusername', 'mypassword')
  .then(function (response) {

    if(response) {
        // login was successful
    } else {
        // login failed
    }
  
  })

About

API to interact with Wharton Webservices

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published