{
  "openapi": "3.0.0",
  "info": {
    "title": "Lafayette College Web Data Services",
    "description": "Information about people and courses at Lafayette College",
    "contact": {
      "name": "Integrations",
      "email": "integrations@lafayette.edu"
    },
    "version": "3.0.0"
  },
  "servers": [
    {
      "url": "https://webdataservices.lafayette.edu"
    }
  ],
  "security": [
    {
      "apikey": []
    }
  ],
  "components": {
    "securitySchemes": {
      "apikey": {
        "type": "apiKey",
        "name": "apikey",
        "in": "header"
      }
    },
    "schemas": {
      "Department": {
        "type": "object",
        "required": [
          "title"
        ],
        "properties": {
          "title": {
            "type": "string"
          },
          "description": {
            "type": "string"
          },
          "email": {
            "type": "string",
            "format": "email"
          },
          "fax": {
            "type": "string"
          },
          "emergency": {
            "type": "boolean"
          },
          "phone": {
            "type": "string"
          },
          "location": {
            "type": "string"
          },
          "website": {
            "type": "string"
          }
        },
        "example": {
          "title": "Admissions",
          "description": "Lafayette students transcend academic boundaries by working with dedicated faculty and students of other majors to solve problems on a local and global scale. These experiences transform our students into the critical thinkers and dynamic leaders who will change tomorrow.",
          "email": "admissions@lafayette.edu",
          "fax": "6103305355",
          "emergency": false,
          "phone": "6103305100",
          "location": "118 Markle Hall",
          "website": "http://admissions.lafayette.edu"
        }
      },
      "Building": {
        "type": "object",
        "required": [
          "title",
          "id"
        ],
        "properties": {
          "title": {
            "type": "string"
          },
          "id": {
            "type": "string"
          },
          "description": {
            "type": "string"
          },
          "latitude": {
            "type": "number"
          },
          "longitude": {
            "type": "number"
          },
          "address": {
              "type": "string"
          },
          "image": {
            "type": "string",
            "format": "base64"
          },
          "building_type": {
            "type": "array",
            "items": {
              "type": "string"
            }
          }
        },
        "example": {
          "id": "59d7c1db54666c0f513898ba",
          "title": "Williams Visual Arts Building",
          "building_type": [
            "Academic",
            "Arts"
          ],
          "latitude": "40.6953331282",
          "longitude": "-75.2091173812",
          "description": "One of the leading high-tech facilities for art education and exhibitions in the nation, the WVAB enables students to work with professional artists and gain the skills needed for successful careers in the visual arts. It houses painting, sculpture, and drawing studios, the Grossman Gallery, and the Community-Based Teaching Program.",
          "address": "243 North Third Street",
          "image": "\\/APrUUcrFzI\\/\\/2Q=="
        }
      },
      "Program": {
        "type": "object",
        "required": [
          "id",
          "title",
          "description"
        ],
        "properties": {
          "id": {
            "type": "string"
          },
          "title": {
            "type": "string"
          },
          "description": {
            "type": "string"
          },
          "keywords": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "website": {
            "type": "string"
          },
          "image": {
            "type": "string",
            "format": "base64"
          }
        },
        "example": {
          "id": "59d7859e3711aae19ad8f7e4",
          "title": "Africana Studies",
          "description": "Students curious about the black experience and the African Diaspora will find engaging coursework that challenges them to think across the disciplines of history, literature and languages, economics, art history, music, anthropology and sociology, folklore, religion, philosophy, and political science..",
          "keywords": [
            "africana studies",
            "Africana Studies",
            "africology",
            "africa",
            "africa studies"
          ],
          "website": "http://africana.lafayette.edu",
          "image": "dBw6S/4t9Ve+BX+0an2V6fs55fG2rx/="
        }
      },
      "DepartmentAssignment": {
        "type": "object",
        "required": [
          "DEPT",
          "HOME"
        ],
        "properties": {
          "DEPT": {
            "type": "string"
          },
          "HOME": {
            "type": "string"
          }
        }
      },
      "TermCode": {
        "type": "string",
        "pattern": "[0-9]{4}[12345]0",
        "minLength": 6,
        "maxLength": 6,
        "example": 201710
      },
      "CourseReferenceNumber": {
        "type": "string",
        "pattern": "[12345]0[0-9]{3}",
        "minLength": 5,
        "maxLength": 5,
        "example": 30472
      },
      "Course": {
        "type": "object",
        "required": [
          "INSTRUCTOR_LNUMBER",
          "CRN",
          "TERM_CODE"
        ],
        "properties": {
          "INSTRUCTOR_LNUMBER": {
            "type": "string"
          },
          "TERM_CODE": {
            "$ref": "#/components/schemas/TermCode"
          },
          "CRN": {
            "$ref": "#/components/schemas/CourseReferenceNumber"
          },
          "SUBJ_CODE": {
            "type": "string"
          },
          "CRSE_NUMB": {
            "type": "integer"
          },
          "SEQ_NUMB": {
            "type": "integer"
          },
          "ENROLL": {
            "type": "integer"
          },
          "CTYP_CODE": {
            "type": "integer"
          },
          "PERCENT": {
            "type": "integer"
          },
          "CRS": {
            "type": "string"
          },
          "XLST_GROUP": {
            "type": "string"
          },
          "DIVS_CODE": {
            "type": "string"
          },
          "DEPT_CODE": {
            "type": "string"
          },
          "TITLE": {
            "type": "string"
          }
        },
        "example": {
          "INSTRUCTOR_LNUMBER": "LP00001",
          "TERM_CODE": "201710",
          "CRN": "10725",
          "SUBJ_CODE": "EVSC",
          "CRSE_NUMB": "211",
          "SEQ_NUMB": "01",
          "ENROLL": "2",
          "SCREDIT": "1",
          "CTYP_CODE": "1",
          "PERCENT": "50",
          "CRS": "EVSC_211_01",
          "XLST_GROUP": "B3",
          "DIVS_CODE": "NAT",
          "DEPT_CODE": "EVSC",
          "TITLE": "River Form & Function"
        }
      },
      "Leave": {
        "type": "object",
        "required": [
          "LREA_CODE",
          "START_DATE"
        ],
        "properties": {
          "LREA_CODE": {
            "type": "string",
            "enum": [
              "FN",
              "AD",
              "P",
              "D",
              "M",
              "S",
              "AB",
              "F",
              "LD"
            ]
          },
          "SBTY_CODE": {
            "type": "string",
            "enum": [
              "RLYR",
              "SBYR",
              "ENSE",
              "ENYR",
              "RLSE",
              "SBSE"
            ],
            "nullable": true
          },
          "START_DATE": {
            "type": "string"
          },
          "END_DATE": {
            "type": "string",
            "nullable": true
          }
        },
        "example": {
          "LREA_CODE": "S",
          "SBTY_CODE": "SBSE",
          "START_DATE": "01-AUG-2016",
          "END_DATE": "31-DEC-2016"
        }
      },
      "CommitteeService": {
        "type": "object",
        "required": [
          "COMM_CODE",
          "START_DATE"
        ],
        "properties": {
          "COMM_CODE": {
            "type": "string"
          },
          "COMM_DESC": {
            "type": "string"
          },
          "START_DATE": {
            "type": "string"
          },
          "END_DATE": {
            "type": "string"
          },
          "COMM_STATUS": {
            "type": "string",
            "enum": [
              "CH",
              "EX",
              "CE",
              "VC"
            ],
            "nullable": true
          }
        },
        "example": {
          "COMM_CODE": "C_ATWG",
          "COMM_DESC": "Athletics Working Group",
          "START_DATE": "01-AUG-2006",
          "END_DATE": "31-JUL-2007",
          "COMM_STATUS": null
        }
      },
      "Instructor": {
        "type": "object",
        "required": [
          "LNUMBER",
          "EMAIL"
        ],
        "properties": {
          "LNUMBER": {
            "type": "string"
          },
          "EMAIL": {
            "type": "string",
            "format": "email"
          },
          "FIRST_NAME": {
            "type": "string"
          },
          "LAST_NAME": {
            "type": "string"
          },
          "NETID": {
            "type": "string"
          },
          "RANK": {
            "type": "string"
          },
          "DEPARTMENTS": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/DepartmentAssignment"
            }
          }
        },
        "example": {
          "LNUMBER": "LP00001",
          "EMAIL": "CLOUSEAR@LAFAYETTE.EDU",
          "FIRST_NAME": "Rene",
          "LAST_NAME": "Clouseau",
          "RANK": "Associate Professor",
          "NETID": "clousear",
          "DEPARTMENTS": [
            {
              "DEPT": "ECON",
              "HOME": true
            }
          ]
        }
      },
      "DepartmentChair": {
        "type": "object",
        "required": [
          "LNUMBER",
          "EMAIL"
        ],
        "properties": {
          "LNUMBER": {
            "type": "string"
          },
          "EMAIL": {
            "type": "string",
            "format": "email"
          },
          "NETID": {
            "type": "string"
          },
          "CHAIR": {
            "type": "string"
          }
        },
        "example": {
          "LNUMBER": "LP00001",
          "EMAIL": "CLOUSEAR@LAFAYETTE.EDU",
          "CHAIR": "ECON",
          "NETID": "clousear"
        }
      },
      "Faculty": {
        "type": "object",
        "required": [
          "LNUMBER",
          "EMAIL"
        ],
        "properties": {
          "LNUMBER": {
            "type": "string"
          },
          "EMAIL": {
            "type": "string",
            "format": "email"
          },
          "FIRST_NAME": {
            "type": "string"
          },
          "LAST_NAME": {
            "type": "string"
          },
          "NETID": {
            "type": "string"
          },
          "RANK": {
            "type": "string"
          },
          "DEPARTMENTS": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/DepartmentAssignment"
            }
          },
          "PIDM": {
            "type": "integer"
          },
          "DIVISION": {
            "type": "string",
            "enum": [
              "VDEN",
              "VDHU",
              "VDNS",
              "VDSS"
            ],
            "nullable": true
          },
          "GENDER": {
            "type": "string",
            "enum": [
              "F",
              "M",
              "N"
            ]
          },
          "ETHNICITY": {
            "type": "string"
          },
          "ETHNICITY_CODE": {
            "type": "string"
          },
          "LEAVE_STATUS": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Leave"
            }
          },
          "COMM_HISTORY": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/CommitteeService"
            }
          },
          "TENURE": {
            "type": "string",
            "nullable": true
          },
          "POSITION_ELIGIBILITY_DATE": {
            "type": "string"
          }
        },
        "example": {
          "PIDM": "13567315316",
          "LNUMBER": "LP00001",
          "EMAIL": "clousear@lafayette.edu",
          "FIRST_NAME": "Rene",
          "LAST_NAME": "Clouseau",
          "GENDER": "M",
          "ETHNICITY_CODE": "CA",
          "ETHNICITY": "Caucasian",
          "RANK": "Associate Professor",
          "RANK_CODE": "2",
          "TENURE": "O",
          "DIVISION": "VDSS",
          "POSITION_ELIGIBILITY_DATE": "01-AUG-13",
          "NETID": "clousear",
          "LEAVE_STATUS": [
            {
              "LREA_CODE": "S",
              "SBTY_CODE": "RLSE",
              "START_DATE": "01-AUG-2017",
              "END_DATE": "31-DEC-2017"
            }
          ],
          "COMM_HISTORY": [
            {
              "COMM_CODE": "P_CCE",
              "COMM_DESC": "Cntr Community Engagement Adv",
              "START_DATE": "01-AUG-2014",
              "END_DATE": "31-JUL-2017",
              "COMM_STATUS": null
            },
            {
              "COMM_CODE": "F_A&G",
              "COMM_DESC": "Appeal and Grievance",
              "START_DATE": "01-AUG-2015",
              "END_DATE": "31-JUL-2017",
              "COMM_STATUS": null
            },
            {
              "COMM_CODE": "F_FCC",
              "COMM_DESC": "Faculty Compensation",
              "START_DATE": "01-AUG-2016",
              "END_DATE": "31-JUL-2017",
              "COMM_STATUS": null
            }
          ],
          "DEPARTMENTS": [
            {
              "DEPT": "ECON",
              "HOME": true
            }
          ]
        }
      },
      "Person": {
        "type": "object",
        "required": [
          "LNUMBER",
          "EMAIL"
        ],
        "properties": {
          "LNUMBER": {
            "type": "string"
          },
          "EMAIL": {
            "type": "string",
            "format": "email"
          },
          "FIRST_NAME": {
            "type": "string"
          },
          "MIDDLE_NAME": {
            "type": "string"
          },
          "LAST_NAME": {
            "type": "string"
          },
          "PREFERRED_FIRST_NAME": {
              "type": "string"
          },
          "USERNAME": {
            "type": "string"
          },
          "CONFIDENTIALITY_FLAG": {
            "type": "string",
            "enum": [
              "1",
              ""
            ]
          },
          "IMAGE": {
            "type": "string",
            "format": "base64"
          },
          "IMAGE_REFRESH_DATE": {
            "type": "string"
          },
          "TITLE": {
            "type": "string"
          },
          "OFFICE": {
            "type": "string"
          },
          "DEPARTMENT": {
            "type": "string"
          },
          "PHONE_NUMBER": {
            "type": "string"
          },
          "CLASS_YEAR": {
            "type": "string"
          },
          "CAMPUS_BOX": {
            "type": "string"
          },
          "MAJOR": {
            "type": "string"
          },
          "ADVISOR": {
            "type": "string"
          }
        },
        "example": {
          "LNUMBER": "LP00001",
          "TITLE": "Associate Professor",
          "OFFICE": "101 Simon Center",
          "DEPARTMENT": "Economics",
          "PHONE_NUMBER": "6103307032",
          "CONFIDENTIALITY_FLAG": "",
          "FIRST_NAME": "Rene",
          "LAST_NAME": "Clouseau",
          "MIDDLE_NAME": "R.",
          "PREFERRED_FIRST_NAME": "",
          "EMAIL": "clousear@lafayette.edu",
          "USERNAME": "clousear",
          "IMAGE": "",
          "IMAGE_REFRESH_DATE": "2016-02-01"
        }
      },
      "Term": {
        "type": "object",
        "required": [
          "TERM_CODE",
          "START_DATE",
          "END_DATE"
        ],
        "properties": {
          "TERM_CODE": {
            "$ref": "#/components/schemas/TermCode"
          },
          "START_DATE": {
            "type": "string"
          },
          "END_DATE": {
            "type": "string"
          }
        },
        "example": {
          "TERM_CODE": "201710",
          "START_DATE": "28-AUG-17",
          "END_DATE": "18-DEC-17"
        }
      }
    }
  },
  "paths": {
    "/departments": {
      "get": {
        "description": "Returns information about departments and offices on campus.",
        "operationId": "getDepartments",
        "responses": {
          "200": {
            "description": "An array of departments.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/Department"
                  }
                }
              }
            }
          }
        },
        "parameters": [
          {
            "name": "emergency",
            "in": "query",
            "required": false,
            "description": "Filter on whether this department/office is an emergency contact.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "security": [
          {
            "apikey": []
          }
        ]
      }
    },
    "/buildings": {
      "get": {
        "description": "Returns information about buildings on campus.",
        "operationId": "getBuildings",
        "responses": {
          "200": {
            "description": "An array of buildings.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/Building"
                  }
                }
              }
            }
          }
        },
        "parameters": [
          {
            "name": "image",
            "in": "query",
            "required": false,
            "description": "Whether or not to return building image. Defaults to false.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "security": [
          {
            "apikey": []
          }
        ]
      }
    },
    "/buildingTypes": {
      "get": {
        "description": "Returns the building type taxonomy items.",
        "operationId": "getBuildingTypes",
        "responses": {
          "200": {
            "description": "An array of building types.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "type": "string"
                  }
                }
              }
            }
          }
        },
        "security": [
          {
            "apikey": []
          }
        ]
      }
    },
    "/programs": {
      "get": {
        "description": "Returns information about academic program offerings.",
        "operationId": "getPrograms",
        "responses": {
          "200": {
            "description": "An array of programs meeting search criteria, or all programs if no criteria specified.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/Program"
                  }
                }
              }
            }
          }
        },
        "parameters": [
          {
            "name": "query",
            "in": "query",
            "required": false,
            "description": "A search query to search programs for.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "image",
            "in": "query",
            "required": false,
            "description": "Whether or not to return program image for full program listing.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "id",
            "in": "query",
            "required": false,
            "description": "A MongoDB ID for a particular program to return.",
            "schema": {
                "type": "string"
            }
          }
        ],
        "security": [
          {
            "apikey": []
          }
        ]
      }
    },
    "/person": {
      "get": {
        "description": "Returns a list of (online) Directory-eligible people.",
        "operationId": "getPerson",
        "parameters": [
          {
            "name": "username",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            },
            "description": "A username to query for."
          },
          {
            "name": "lnumber",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            },
            "description": "An lnumber to query for."
          },
          {
            "name": "email",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            },
            "description": "An email address to query for."
          },
          {
            "name": "confidentiality_flag",
            "in": "query",
            "required": false,
            "schema": {
              "type": "boolean"
            },
            "description": "A filter for the confidentiality flag."
          },
          {
            "name": "image",
            "in": "query",
            "required": false,
            "schema": {
              "type": "boolean"
            },
            "description": "An option to return the person's id photo"
          },
          {
            "name": "image_refresh_date",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            },
            "description": "When used with the image parameter, only return images newer than the provided date."
          },
          {
            "name": "image_height",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer"
            },
            "description": "When used with the image parameter, resize image to given height."
          },
          {
            "name": "image_width",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer"
            },
            "description": "When used with the image parameter, resize image to given width."
          }
        ],
        "responses": {
          "200": {
            "description": "An array of people.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/Person"
                  }
                }
              }
            }
          }
        },
        "security": [
          {
            "apikey": []
          }
        ]
      }
    },
    "/committeeEligibleFaculty": {
      "get": {
        "description": "Returns a list of faculty eligible for service on committees on the given date.",
        "operationId": "getCommitteeEligibleFaculty",
        "parameters": [
          {
            "name": "date",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "A date to query for."
          }
        ],
        "responses": {
          "200": {
            "description": "An array of faculty.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/Faculty"
                  }
                }
              }
            }
          }
        },
        "security": [
          {
            "apikey": []
          }
        ]
      }
    },
    "/departmentheads": {
      "get": {
        "description": "Returns a list of department heads and program chairs for the given term.",
        "operationId": "getDepartmentHeads",
        "parameters": [
          {
            "name": "term",
            "in": "query",
            "required": true,
            "schema": {
              "$ref": "#/components/schemas/TermCode"
            },
            "description": "A specific term code to query for."
          },
          {
            "name": "department",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            },
            "description": "A department to filter courses by."
          }
        ],
        "responses": {
          "200": {
            "description": "An array of department heads.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/DepartmentChair"
                  }
                }
              }
            }
          }
        },
        "security": [
          {
            "apikey": []
          }
        ]
      }
    },
    "/instructors": {
      "get": {
        "description": "Returns a list of instructors teaching at least one course in the given term.",
        "operationId": "getInstructors",
        "parameters": [
          {
            "name": "term",
            "in": "query",
            "required": true,
            "schema": {
              "$ref": "#/components/schemas/TermCode"
            },
            "description": "A specific term code to query for."
          },
          {
            "name": "department",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            },
            "description": "A department to filter courses by."
          }
        ],
        "responses": {
          "200": {
            "description": "An array of instructors teaching a course in the given term",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/Instructor"
                  }
                }
              }
            }
          }
        },
        "security": [
          {
            "apikey": []
          }
        ]
      }
    },
    "/termInfo": {
      "get": {
        "description": "Returns start and end date information for academic terms.",
        "operationId": "getTermInfo",
        "parameters": [
          {
            "name": "term",
            "in": "query",
            "required": false,
            "schema": {
              "$ref": "#/components/schemas/TermCode"
            },
            "description": "A specific term code to query for."
          },
          {
            "name": "year",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer"
            },
            "description": "A year to query for all academic terms."
          }
        ],
        "responses": {
          "200": {
            "description": "An array of terms matching the queried criteria if specified, all known terms otherwise.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/Term"
                  }
                }
              }
            }
          }
        },
        "security": [
          {
            "apikey": []
          }
        ]
      }
    },
    "/courses": {
      "get": {
        "description": "Returns information about all the courses for a specified term. Courses are unique for an Instructor/CRN pair, meaning that a cross-listed, team-taught course would have a total of four entries in the list.",
        "operationId": "getCoursesByTerm",
        "responses": {
          "200": {
            "description": "An array of courses in the given term",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/Course"
                  }
                }
              }
            }
          }
        },
        "parameters": [
          {
            "name": "term",
            "in": "query",
            "required": true,
            "description": "This a term code expressed like 201630, which corresponds to the Spring semester of the 2016-2017 academic year.",
            "schema": {
              "$ref": "#/components/schemas/TermCode"
            }
          },
          {
            "name": "instructor_required",
            "in": "query",
            "required": false,
            "description": "Whether or not to only include courses that have an assigned instructor. Defaults to false.",
            "schema": {
              "type": "boolean"
            }
          }
        ],
        "security": [
          {
            "apikey": []
          }
        ]
      }
    }

  }
}