Code Monkey home page Code Monkey logo

njit-api's Introduction

NJIT API

Welcome to NJIT's API! This is an open source project created by Jay Ravaliya (@jayrav13). Members of the community are encouraged to contribute!

About

The purpose of building this project out is simple - there is a lot of data available on campus, but is disparate and not uniformally accessible. Bringing this data together and making it available to students, courses and organizations will have a multiplying effect on what we're able to build for our community.

Register

Users can register to use this API by making the following HTTP request:

curl -i -X GET "https://njit-api.herokuapp.com/api/v0.1/users"
	-H "Content-Type: application/json"
	-d '{
		"name": "Jay Ravaliya",
		"email": "[email protected]",
		"password": "password"
	}'

The response will be a User object:

{
  "status": 200,
  "response": {
    "status": 200,
    "description": "OK",
    "type": "Successful",
    "is_successful": true
  },
  "message": null,
  "data": {
    "user": {
      "email": "[email protected]",
      "name": "Jay Ravaliya",
      "updated_at": "2016-08-16 05:52:54",
      "created_at": "2016-08-16 05:52:54",
      "id": 6
    },
    "api_token": "..."
  },
  "response_time": 0.1802179813385
}

You'll notice that this includes a key api_token inside the data object. This will be the API Token that is used to make all requests to consume this API's data.

If the email address was already taken:

{
  "status": 400,
  "response": {
    "status": 400,
    "description": "Bad Request",
    "type": "Client Error",
    "is_successful": false
  },
  "message": null,
  "data": {
    "email": [
      "The email has already been taken."
    ]
  },
  "response_time": 0.072494029998779
}

Resources

This API offers GET resources to retrieve different data models by unique endpoints. All resources must include api_token as a query string parameter.

Sample Request

$ curl -i -X GET "https://njit-api-stage.herokuapp.com/api/v0.1/buildings?api_token=..."

GET /api/v0.1/buildings

Source: http://www.njit.edu/about/visit/njit-maps.php

{
  "status": 200,
  "response": {
    "status": 200,
    "description": "OK",
    "type": "Successful",
    "is_successful": true
  },
  "message": null,
  "data": [
    {
      "id": 1,
      "name": "Student Mall \/ Parking Deck",
      "website_id": 1,
      "google_place_id": "ChIJP-qtPYJUwokRZp7m-pDLNoo",
      "created_at": "2016-08-13 01:36:34",
      "updated_at": "2016-08-13 01:36:34"
    },
    { ... }
  ],
  "response_time": 0.21713209152222
}

GET /api/v0.1/events

Source: http://r25livepr1.njit.edu/calendar/

{
  "status": 200,
  "response": {
    "status": 200,
    "description": "OK",
    "type": "Successful",
    "is_successful": true
  },
  "message": null,
  "data": [
    {
      "id": 1,
      "name": "NJ Region of the NYC Church of Christ",
      "summary": "NJ Region of the NYC Church of Christ",
      "location": "Campus Center Ballroom \"A\", Campus Center Conference Room 240, Campus Center Conference Room 220, Campus Center Conference Room 225",
      "dtstart": "20160814T080000",
      "dtend": "20160814T150000",
      "all_day": false,
      "organization": "Conference Services",
      "description": "None",
      "category": "Lecture, Seminar, Workshop",
      "created_at": "2016-08-16 06:03:24",
      "updated_at": "2016-08-16 06:03:24"
    },
    { ... }
  ],
  "response_time": 0.19863700866699
}

GET /api/v0.1/sports

Source: http://njithighlanders.com/

{
  "status": 200,
  "response": {
    "status": 200,
    "description": "OK",
    "type": "Successful",
    "is_successful": true
  },
  "message": null,
  "data": [
    {
      "id": 1201,
      "name": "Baseball",
      "gender": "o",
      "roster_url": "\/roster.aspx?path=baseball",
      "schedule_url": "\/schedule.aspx?path=baseball",
      "archives_url": "\/archives.aspx?path=baseball",
      "created_at": "2016-08-16 06:03:28",
      "updated_at": "2016-08-16 06:03:30",
      "athletes": [
        {
          "id": 18729,
          "number": 1,
          "image_url": "\/common\/controls\/image_handler.aspx?image_path=\/images\/2015\/9\/24\/Rex MacMillan.jpg&thumb_prefix=rp_roster",
          "name": "Rex MacMillan",
          "year": "Jr.",
          "height": "5-8",
          "weight": 155,
          "position": "UTL",
          "hometown": "Rutherford, NJ \/ Rutherford",
          "sport_id": 1201,
          "created_at": "2016-08-16 06:03:29",
          "updated_at": "2016-08-16 06:03:29"
        },
        { ... }
      ],
      "coaches": [
        {
          "id": 3150,
          "image_url": "\/common\/controls\/image_handler.aspx?image_path=\/images\/2011\/2\/22\/\/Brian Guiliana.jpg&thumb_prefix=rp_roster",
          "name": "Brian Guiliana",
          "title": "Head Baseball Coach",
          "sport_id": 1201,
          "created_at": "2016-08-16 06:03:30",
          "updated_at": "2016-08-16 06:03:30"
        },
        { ... }
      ]
    },
  ],
  "response_time": 0.081201076507568
}

Project Hosts

We currently run on the following hosts:

Name Type Host
njit-api Production https://njit-api.herokuapp.com
njit-api-stage Staging https://njit-api-stage.herokuapp.com

This documentation will ALWAYS reflect Production resources and functionality.

Notes

This project is currently hosted on a free tier instance of Heroku. As such, there are limitations surrounding availability and also, in certain cases, response time. Please be cognizant of these limitations in the short term!

Support?

Contact Jay Ravaliya (@jayrav13) or Open an Issue!

njit-api's People

Contributors

jayrav13 avatar

Stargazers

 avatar Minh Le avatar Neil Patel avatar

Watchers

James Cloos avatar  avatar

Forkers

bsuero

njit-api's Issues

iCal to JSON Library for Python

A simple Google search reveals that there are no current, maintained libraries for parsing iCal data into JSON. Further, this project would specifically require iCal "keys" to be mapped to our database keys for Laravel's ORM to be able to easily create records, so this feature would be an additional requirement.

Would be cool to create this library separately and open source it (and of course subsequently use it in this project!)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.