### List Rooms with Filters (cURL) Source: https://help.unitime.org/manuals/api This example demonstrates how to list rooms using the UniTime API with various filters. It utilizes cURL to send a GET request, specifying the term, room type, and building text as query parameters. The API returns a list of rooms matching the criteria. ```bash curl -uadmin:admin "http://demo.unitime.org/UniTime/api/rooms?term=Fal2010&r:type=Classrooms&r:text=EDUC" ``` -------------------------------- ### Example Request for Computing Suggestions (JSON) Source: https://help.unitime.org/manuals/api This JSON payload is an example request for the 'computeSuggestions' operation of the UniTime API. It includes a list of requested courses and the student's current course assignments. ```json { "request": { "courses": [ { "requestedCourse": [{ "courseName": "ALG 101"}], "waitList": false }, { "requestedCourse": [{ "courseName": "COM 101"}], "waitList": false }, { "requestedCourse": [{ "courseName": "PSY 101"}], "waitList": false }, { "requestedCourse": [{ "courseName": "ECON 101"}], "waitList": false }, { "requestedCourse": [{ "courseName": "SOC 101"}], "waitList": false } ], "alternatives": [] }, "currentAssignment": [ { "courseId": 135761, "classId": 231489, "pin": false, "saved": false }, { "courseId": 135762, "classId": 231496, "pin": false, "saved": false }, { "courseId": 135774, "classId": 231570, "pin": false, "saved": false } ] } ], "selectedAssignment": 0 } ``` -------------------------------- ### Example Response for Computing Schedule (JSON) Source: https://help.unitime.org/manuals/api This is an example JSON response from the UniTime API after computing a course schedule. It details the assigned courses, class information, and potential conflicts or limitations. ```json { "assignments": [ { "courseId": 135753, "assigned": true, "subject": "ALG", "courseNbr": "101", "title": "Algebra I", "hasUniqueName": true, "notAvailable": false, "locked": false, "waitListed": false, "assignments": [ { "courseAssigned": true, "courseId": 135753, "classId": 231391, "subpartId": 231390, "days": [ 0, 2, 4 ], "start": 114, "length": 12, "breakTime": 10, "instructos": [ "J Doe" ], "instructoEmails": [ "" ], "rooms": [ "EDUC 103" ], "alternative": false, "hasAlternatives": false, "distanceConflict": false, "datePattern": "08/23 - 12/10", "subject": "ALG", "courseNbr": "101", "subpart": "Lec", "section": "1", "number": "1", "title": "Algebra I", "limit": [ 2, 2 ], "pin": false, "backToBackDistance": 0, "saved": true, "dummy": false, "cancelled": false, "credit": "3|3 Semester Hours of Collegiate Credit" } ] }, ... ], "canEnroll": true, "value": 0.9991 } ``` -------------------------------- ### Example Request for Computing Schedule (JSON) Source: https://help.unitime.org/manuals/api This is an example JSON payload for the 'compute' operation of the UniTime API. It specifies the courses and free time preferences for a student, including course names and desired time slots. ```json { "request": { "alternatives": [], "courses": [ { "requestedCourse": [ { "courseName": "ALG 101" } ], "waitList": false }, { "requestedCourse": [ { "courseName": "COM 101" } ], "waitList": false }, { "requestedCourse": [ { "courseName": "PSY 101" } ], "waitList": false }, { "requestedCourse": [ { "courseName": "ECON 101" }, { "courseName": "ENGR 101" } ], "waitList": false }, { "requestedCourse": [ { "courseName": "SOC 101" } ], "waitList": false }, { "requestedCourse": [ { "freeTime": [ { "days": [ 0, 2, 4 ], "length": 12, "start": 90 } ] } ], "waitList": false } ] } } ``` -------------------------------- ### Example Room Response (JSON) Source: https://help.unitime.org/manuals/api This is an example of the JSON response structure when querying the UniTime Rooms API for a specific room or a list of rooms. It includes detailed properties of a room, such as its building, room type, capacity, and availability. ```json [ { "externalId": "", "building": { "id": 1782, "abbreviation": "EDUC", "name": "Education Hall", "x": 1.0, "y": 1.0 }, "roomType": { "id": 425, "label": "Classrooms", "room": true, "order": 0 }, "capacity": 20, "examCapacity": 2, "x": 1.0, "y": 1.0, "controlDepartment": { "code": "0100", "external": true, "event": true, "externalAbbv": "LLR", "externalLabel": "Large Lecture Room", "canEditRoomSharing": false, "id": 231382, "abbv": "Centr", "label": "Central Office", "color": "#f032f0", "title": "0100 - Central Office ( EXT: Large Lecture Room )" }, "eventDepartment": { "code": "0100", "external": true, "event": true, "externalAbbv": "LLR", "externalLabel": "Large Lecture Room", "canEditRoomSharing": false, "id": 231382, "abbv": "Centr", "label": "Central Office", "color": "#f032f0", "title": "0100 - Central Office ( EXT: Large Lecture Room )" }, "departments": [ { "code": "0101", "external": false, "event": true, "canEditRoomSharing": false, "id": 231383, "abbv": "Instr", "label": "Student Instructional Planning", "color": "#32f0f0", "title": "0101 - Student Instructional Planning" }, { "code": "0100", "external": true, "event": true, "externalAbbv": "LLR", "externalLabel": "Large Lecture Room", "canEditRoomSharing": false, "id": 231382, "abbv": "Centr", "label": "Central Office", "color": "#f032f0", "title": "0100 - Central Office ( EXT: Large Lecture Room )" } ], "groups": [ { "id": 1245148, "abbv": "Classroom", "label": "Classroom" } ], "features": [ { "id": 1245150, "abbv": "CompPr", "label": "Computer Projection" }, { "id": 1245149, "abbv": "FixSeat", "label": "Fixed Seating" } ], "examTypes": [ { "id": 1540050, "reference": "midterm", "label": "Midterm", "final": false }, { "id": 1540049, "reference": "final", "label": "Final", "final": true } ], "ignoreTooFar": false, "ignoreRoomCheck": false, "availability": "LLR Mon 7:30a - 6:30p\nLLR TWThF 7:30a - 1:30p\nInstr Tue 1:30p - 3:30p\nLLR TWThF 3:30p - 6:30p\nLLR Wed 1:30p - 3:30p\nInstr Thu 1:30p - 3:30p\nLLR Fri 1:30p - 3:30p", "eventAvailability": "", "defaultEventStatus": 1, "defaultBreakTime": 0, "canShowDetail": true, "canSeeAvailability": true, "canSeePeriodPreferences": true, "canSeeEventAvailability": true, "canChange": true, "canChangeAvailability": true, "canChangeControll": false, "canChangeExternalId": false, "canChangeType": false, "canChangeCapacity": false, "canChangeExamStatus": false, "canChangeRoomProperties": false, "canChangeEventProperties": false, "canChangePicture": true, "canChangePreferences": true, "canChangeGroups": true, "canChangeFeatures": true, "canChangeEventAvailability": true, "canDelete": false, "miniMapUrl": "https://maps.google.com/maps/api/staticmap?center\u003d1.0,1.0\u0026zoom\u003d15\u0026size\u003d300x200\u0026maptype\u003droadmap\u0026sensor\u003dfalse\u0026markers\u003dcolor:blue|1.0,1.0", "mapUrl": "https://maps.google.com/maps/api/staticmap?center\u003d1.0,1.0\u0026zoom\u003d16\u0026size\u003d600x400\u0026maptype\u003droadmap\u0026sensor\u003dfalse\u0026markers\u003dcolor:blue|1.0,1.0", "pictures": [], "lastChange": "Last update was made by A. Root at 10/19/2015 03:17PM", "sessionId": 231379, "sessionName": "Fal 2010 (woebegon)", "uniqueId": 8023, "abbv": "", "name": "101", "params": { "overbook": "1", "permId": "1" } }, ... ] ``` -------------------------------- ### Retrieve Single Room by ID (cURL) Source: https://help.unitime.org/manuals/api This example shows how to retrieve detailed information for a specific room using its unique ID. It employs cURL to make a GET request to the UniTime API, including the term, room type, and the room's ID as query parameters. The response for a single room includes extended details such as room sharing and availability. ```bash curl -uadmin:admin "http://demo.unitime.org/UniTime/api/rooms?term=Fal2010&r:type=Classrooms&r:id=8023" ``` -------------------------------- ### GET /api/script?log= - Get Script Log Source: https://help.unitime.org/manuals/api Retrieves the execution log for a specific script using its execution ID. ```APIDOC ## GET /api/script?log= ### Description Retrieves the execution log associated with a specific script run, identified by its unique execution ID. ### Method GET ### Endpoint `/UniTime/api/script` ### Parameters #### Query Parameters - **log** (string) - Required - The unique identifier of the script execution whose log is to be retrieved. ### Request Example ```bash curl -uadmin:admin "http://demo.unitime.org/UniTime/api/script?log=133c3bab-a9ac-477e-b49d-04af10ba238d" ``` ### Response #### Success Response (200) - (string) - The content of the script execution log. ``` -------------------------------- ### Execute Script Immediately (POST) Source: https://help.unitime.org/manuals/api Executes a script immediately and returns the resulting file or script log. Requires a term and script name. Additional parameters can be appended. The payload can contain an input file. ```bash curl -uadmin:admin "http://demo.unitime.org/UniTime/api/script?term=Fal2010&script=Example+script&queue=false&dept=0100&subjects=ALG&subjects=BAND&subjects=BIOL&name=Johnny" ``` -------------------------------- ### GET /api/script?id= - Get Execution Status Source: https://help.unitime.org/manuals/api Retrieves the status and details of a previously initiated script execution using its unique ID. ```APIDOC ## GET /api/script?id= ### Description Retrieves detailed information about a script execution, including its status, progress, logs, and output details, using its unique execution ID. ### Method GET ### Endpoint `/UniTime/api/script` ### Parameters #### Query Parameters - **id** (string) - Required - The unique identifier of the script execution. ### Request Example ```bash curl -uadmin:admin "http://demo.unitime.org/UniTime/api/script?id=133c3bab-a9ac-477e-b49d-04af10ba238d" ``` ### Response #### Success Response (200) - **id** (string) - Unique identifier for the script execution. - **name** (string) - The name of the script. - **status** (string) - The current status of the script (e.g., "All done."). - **progress** (string) - Progress indicator for the script. - **owner** (string) - The owner of the script execution. - **session** (string) - The academic session. - **output** (string) - The name of the resultant output file. - **log** (string) - The script execution log. - **host** (string) - The host server where the script is running. - **outputLink** (string) - A link to download the output file. - **created** (string) - Timestamp when the script execution was created. - **started** (string) - Timestamp when the script execution started. - **finished** (string) - Timestamp when the script execution finished. - **canDelete** (boolean) - Indicates if the execution can be deleted. - **executionRequest** (object) - Details about the execution request. - **id** (number) - The ID of the execution request. - **name** (string) - The name of the execution request. - **parameters** (object) - Parameters passed to the script. #### Response Example ```json { "id": "133c3bab-a9ac-477e-b49d-04af10ba238d", "name": "Example script", "status": "All done.", "progress": "", "owner": "Root, Abraham", "session": "Fal 2010 (woebegon)", "output": "test.txt", "log": "\u003cb\u003eStarting up…", "host": "demo-173", "outputLink": "qpfile?q\u003dJ4jV7c_EkI2SdFEkS4oOq-_AsnCAdQkHgtcTUJm-GCbCruzT1zTYIX9wBwi2zgNn", "created": "2019-04-24T16:11:36Z", "started": "2019-04-24T16:11:36Z", "finished": "2019-04-24T16:12:13Z", "canDelete": true, "executionRequest": { "id": 1736704, "name": "Example script", "parameters": { "subjects": "799,800,801", "name": "Johnny", "dept": "231382" } } } ``` ``` -------------------------------- ### GET /api/script?output= - Get Resultant File Source: https://help.unitime.org/manuals/api Retrieves the resultant output file generated by a script execution, identified by its execution ID. ```APIDOC ## GET /api/script?output= ### Description Retrieves the output file generated by a completed script execution. The script execution is identified by its unique ID. ### Method GET ### Endpoint `/UniTime/api/script` ### Parameters #### Query Parameters - **output** (string) - Required - The unique identifier of the script execution whose output file is to be retrieved. ### Request Example ```bash curl -uadmin:admin "http://demo.unitime.org/UniTime/api/script?output=133c3bab-a9ac-477e-b49d-04af10ba238d" ``` ### Response #### Success Response (200) - (file) - The content of the resultant output file. ``` -------------------------------- ### Retrieve Resultant File (GET) Source: https://help.unitime.org/manuals/api Downloads the resultant file generated by a script execution using its ID. This is the primary way to get the output of successful script runs. ```bash curl -uadmin:admin "http://demo.unitime.org/UniTime/api/script?output=133c3bab-a9ac-477e-b49d-04af10ba238d" ``` -------------------------------- ### Enable Simple Room Sharing (Solver Config) Source: https://help.unitime.org/manuals/examination-timetabling Enables a simplified room sharing model for exams of the same length. This requires setting the 'Exams.RoomSharingClass' parameter to 'org.cpsolver.exam.model.SimpleExamRoomSharing'. Existing 'Can Share Room' preferences must be removed. ```text Exams.RoomSharingClass = org.cpsolver.exam.model.SimpleExamRoomSharing ``` -------------------------------- ### Get Script Execution Status (GET) Source: https://help.unitime.org/manuals/api Retrieves the current status and details of a script execution using its unique ID. This is useful for monitoring scripts submitted via the queue. ```bash curl -uadmin:admin "http://demo.unitime.org/UniTime/api/script?id=133c3bab-a9ac-477e-b49d-04af10ba238d" ```