ASPC

Associated Students of Pomona College

ASPC API

ASPC API

A standardized way to access ASPC features. Currently there is only an API for the Menu.

Authentication Token

You must login to obtain your authentication token.

Example using cURL

	
curl -H "Authorization: Token YOUR_TOKEN" https://aspc.pomona.edu/api/menu/
	
	OR
	
curl "https://aspc.pomona.edu/api/menu/?auth_token=YOUR_TOKEN"
	

Example using JavaScript

		
var auth_token = 'YOUR_TOKEN',
	api_endpoint = 'https://aspc.pomona.edu/api/menu/',
	response = null;

// Requires jQuery
$.ajax({
	url: api_endpoint,
	data: {auth_token: auth_token}
}).done(function (data) {
	response = data;
});
		
	

Example using Python

		
import requests
import json

response = requests.get(
	'https://aspc.pomona.edu/api/menu/',
	params = {
		'auth_token': 'YOUR_TOKEN'
	}
)

data = json.loads(response.text)
		
	

All Menus [/api/menu/]

Lists all menus

Example request (GET)

	
curl "https://aspc.pomona.edu/api/menu/?auth_token=YOUR_TOKEN"
	

Example response 200 (application/json)

[
    {
        "day": "fri",
        "dining_hall": "cmc",
        "food_items": "[\"Breakfast Selections\", \"Scrambled Eggs\\nCheese & Bacon Eggs\\nTurkey Bacon & Sausage Patties\\nChorizo & Cheese Quesadilla\", \"Oatmeal & Grits\\nWaffles\\nHash Browns \\nCranberry & Apple Cinnamon Muffins\", \"Make Your Own Waffle Station\"]",
        "id": 11,
        "meal": "breakfast"
    },
    {
        "day": "fri",
        "dining_hall": "cmc",
        "food_items": "[\"Chocolate Chip Cookies\\nCinnamon Roll Cheesecake Cookies\\nPina Colada Bar\\nLemon Blueberry Pound Cake\", \"Red Velvet Cake\\nVegan Banana Cream Pie\\nMade Without Gluten Rochers\"]",
        "id": 13,
        "meal": "dessert"
    }, ...
]

Lists all menus by a specific dining hall

Parameters

  • dining_hall (enum[string])

    Name of the dining hall

    • Members
      • frary
      • frank
      • cmc
      • mudd
      • scripps
      • oldenborg

Example request (GET)

	
curl "https://aspc.pomona.edu/api/menu/dining_hall/cmc?auth_token=YOUR_TOKEN"
	

Example response 200 (application/json)

[
    {
        "day": "fri",
        "dining_hall": "cmc",
        "food_items": "[\"Breakfast Selections\", \"Scrambled Eggs\\nCheese & Bacon Eggs\\nTurkey Bacon & Sausage Patties\\nChorizo & Cheese Quesadilla\", \"Oatmeal & Grits\\nWaffles\\nHash Browns \\nCranberry & Apple Cinnamon Muffins\", \"Make Your Own Waffle Station\"]",
        "id": 11,
        "meal": "breakfast"
    },
    {
        "day": "fri",
        "dining_hall": "cmc",
        "food_items": "[\"Chocolate Chip Cookies\\nCinnamon Roll Cheesecake Cookies\\nPina Colada Bar\\nLemon Blueberry Pound Cake\", \"Red Velvet Cake\\nVegan Banana Cream Pie\\nMade Without Gluten Rochers\"]",
        "id": 13,
        "meal": "dessert"
    }, ...
]

Lists all menus by a specific day of the week

Parameters

  • day (enum[string])

    Name of the day of the week

    • Members
      • mon
      • tue
      • wed
      • thu
      • fri
      • sat
      • sun

Example request (GET)

	
curl "https://aspc.pomona.edu/api/menu/day/fri?auth_token=YOUR_TOKEN"
	

Example response 200 (application/json)

[
    {
        "day": "fri",
        "dining_hall": "cmc",
        "food_items": "[\"Breakfast Selections\", \"Scrambled Eggs\\nCheese & Bacon Eggs\\nTurkey Bacon & Sausage Patties\\nChorizo & Cheese Quesadilla\", \"Oatmeal & Grits\\nWaffles\\nHash Browns \\nCranberry & Apple Cinnamon Muffins\", \"Make Your Own Waffle Station\"]",
        "id": 11,
        "meal": "breakfast"
    },
    {
        "day": "fri",
        "dining_hall": "cmc",
        "food_items": "[\"Chocolate Chip Cookies\\nCinnamon Roll Cheesecake Cookies\\nPina Colada Bar\\nLemon Blueberry Pound Cake\", \"Red Velvet Cake\\nVegan Banana Cream Pie\\nMade Without Gluten Rochers\"]",
        "id": 13,
        "meal": "dessert"
    }, ...
]

Lists all menus by dining hall and a specific day of the week

Parameters

  • dining_hall (enum[string])

    Name of the dining hall

    • Members
      • frary
      • frank
      • cmc
      • mudd
      • scripps
      • oldenborg
  • day (enum[string])

    Name of the day of the week

    • Members
      • mon
      • tue
      • wed
      • thu
      • fri
      • sat
      • sun

Example request (GET)

	
curl "https://aspc.pomona.edu/api/menu/dining_hall/cmc/day/fri?auth_token=YOUR_TOKEN"
	

Example response 200 (application/json)

[
    {
        "day": "fri",
        "dining_hall": "cmc",
        "food_items": "[\"Breakfast Selections\", \"Scrambled Eggs\\nCheese & Bacon Eggs\\nTurkey Bacon & Sausage Patties\\nChorizo & Cheese Quesadilla\", \"Oatmeal & Grits\\nWaffles\\nHash Browns \\nCranberry & Apple Cinnamon Muffins\", \"Make Your Own Waffle Station\"]",
        "id": 11,
        "meal": "breakfast"
    },
    {
        "day": "fri",
        "dining_hall": "cmc",
        "food_items": "[\"Chocolate Chip Cookies\\nCinnamon Roll Cheesecake Cookies\\nPina Colada Bar\\nLemon Blueberry Pound Cake\", \"Red Velvet Cake\\nVegan Banana Cream Pie\\nMade Without Gluten Rochers\"]",
        "id": 13,
        "meal": "dessert"
    }, ...
]

Find a menu with a specific dining hall, specific day of the week, and meal

Parameters

  • meal (enum[string])

    Name of the dining hall

    • Members
      • breakfast
      • lunch
      • dinner
  • dining_hall (enum[string])

    Name of the dining hall

    • Members
      • frary
      • frank
      • cmc
      • mudd
      • scripps
      • oldenborg
  • day (enum[string])

    Name of the day of the week

    • Members
      • mon
      • tue
      • wed
      • thu
      • fri
      • sat
      • sun

Example request (GET)

	
curl "https://aspc.pomona.edu/api/menu/dining_hall/cmc/day/fri/meal/breakfast?auth_token=YOUR_TOKEN"
	

Example response 200 (application/json)

{
    "day": "fri",
    "dining_hall": "cmc",
    "food_items": "[\"Breakfast Selections\", \"Scrambled Eggs\\nCheese & Bacon Eggs\\nTurkey Bacon & Sausage Patties\\nChorizo & Cheese Quesadilla\", \"Oatmeal & Grits\\nWaffles\\nHash Browns \\nCranberry & Apple Cinnamon Muffins\", \"Make Your Own Waffle Station\"]",
    "id": 11,
    "meal": "breakfast"
}