API Reference

Documentation for the MyHomeworkSpace Public API

Welcome to the MyHomeworkSpace Interactive API Reference! This page shows all endpoints available to your application, as well as how to use them and what responses you can expect from them. To learn more about the MyHomeworkSpace Public API, see Getting Started with the MyHomeworkSpace Public API.


GET admin/getAllFeedback

Suggest changes to this endpoint's documentation with GitHub

Gets all the feedback that was submitted. Note: Accessing this endpoint requires a user.level >= 1.

Sample Response

{
	"status": "ok",
	"feedbacks": [
		{
			"id": 1,
			"userid": 1,
			"type": "smile",
			"text": "I like MyHomeworkSpace",
			"timestamp": "2019-02-07 23:14:10",
			"userName": "Joe Schmo",
			"userEmail": "[email protected]",
			"hasScreenshot": false
		},
		{
			"id": 2,
			"userid": 1,
			"type": "idea",
			"text": "You should have better API documentation",
			"timestamp": "2019-02-07 23:14:46",
			"userName": "Joe Schmo",
			"userEmail": "[email protected]",
			"hasScreenshot": false
		},
	]
}

Body

This request does not accept a body

Try it out

GET admin/getFeedbackScreenshot/:id

Suggest changes to this endpoint's documentation with GitHub

Gets a the screenshot submitted with a particular feedback. Responds with a PNG image.

Body

This request does not accept a body

Try it out

GET admin/getUserCount

Suggest changes to this endpoint's documentation with GitHub

Gets the number of registered users.

Sample Response

{
	"status": "ok",
	"count": 42
}

Body

This request does not accept a body

Try it out

POST auth/changeName

Suggest changes to this endpoint's documentation with GitHub

Changes the name of the signed in user.

Sample Response

{
	"status": "ok"
}

Body

Body Type: application/x-www-form-urlencoded
  • new - text (New name for user) - Required

Try it out

POST auth/clearMigrateFlag

Suggest changes to this endpoint's documentation with GitHub

Disables the migration dialog for the active user.

Sample Response

{
	"status": "ok"
}

Body

This request does not accept a body

Try it out

GET auth/context

Suggest changes to this endpoint's documentation with GitHub

Returns details about the logged in user’s account and settings. If you’re developing a fully featured client, we recommend this API over auth/me, as it returns more information in a single request.

Caution! The response to this endpoint may contain additional fields not described here. These fields are intended for backwards compatibility with older clients, and so may break or disappear at any time. Please ensure you use only the fields described in the sample below.

Sample Response

{
	"status": "ok",
	"classes": [
		{
			"id": 1,
			"name": "Math",
			"teacher": "asdf",
			"color": "ffa540",
			"sortIndex": 0,
			"userId": 1
		},
		{
			"id": 2,
			"name": "History",
			"teacher": "",
			"color": "40ff73",
			"sortIndex": 1,
			"userId": 1
		},
		{
			"id": 3,
			"name": "English",
			"teacher": "",
			"color": "4071ff",
			"sortIndex": 2,
			"userId": 1
		},
		{
			"id": 4,
			"name": "Language",
			"teacher": "",
			"color": "ff4086",
			"sortIndex": 3,
			"userId": 1
		},
		{
			"id": 5,
			"name": "Science",
			"teacher": "",
			"color": "40ccff",
			"sortIndex": 4,
			"userId": 1
		}
	],
	"user": {
		"id": 1,
		"name": "Joe Schmo",
		"email": "[email protected]",
		"type": "mhs",
		"level": 0,
		"emailVerified": true,
		"showMigrateMessage": 0,
		"schools": [
			{
				"enrollmentID": 1,
				"schoolID": "dalton",
				"displayName": "The Dalton School",
				"userDetails": "Signed in as Schmo, Joseph (Joe) '19 (c99js)",
				"emailAddress": "[email protected]",
				"userID": 1
			}
		]
	},
	"prefixes": [
		{
			"id": -1,
			"background": "4C6C9B",
			"color": "FFFFFF",
			"words": [
				"HW",
				"Read",
				"Reading"
			],
			"timedEvent": false,
			"default": true
		},
		{
			"id": -1,
			"background": "9ACD32",
			"color": "FFFFFF",
			"words": [
				"Project"
			],
			"timedEvent": false,
			"default": true
		},
		{
			"id": 1,
			"background": "FF4086",
			"color": "FFFFFF",
			"words": [
				"Custom"
			],
			"timedEvent": false,
			"default": false
		}
	],
	"prefixFallbackBackground": "FFD3BD",
	"prefixFallbackColor": "000000",
	"prefs": [
		{
			"id": 1,
			"key": "background",
			"value": "img:2"
		}
	]
}

Body

This request does not accept a body

Try it out

GET auth/me

Suggest changes to this endpoint's documentation with GitHub

Returns the logged in user’s profile information.

Caution! The response to this endpoint may contain additional fields not described here. These fields are intended for backwards compatibility with older clients, and so may break or disappear at any time. Please ensure you use only the fields described in the sample below.

Sample Response

{
	"status": "ok",
	"user": {
		"id": 1,
		"name": "Joe Schmo",
		"email": "[email protected]",
		"type": "mhs",
		"level": 0,
		"emailVerified": true,
		"showMigrateMessage": 0,
		"schools": [
			{
				"enrollmentID": 1,
				"schoolID": "dalton",
				"displayName": "The Dalton School",
				"userDetails": "Signed in as Schmo, Joseph (Joe) '19 (c99js)",
				"emailAddress": "[email protected]",
				"userID": 1
			}
		]
	}
}

Body

This request does not accept a body

Try it out

POST calendar/events/add

Suggest changes to this endpoint's documentation with GitHub

Adds an event to the calendar.

Sample Response

{
	"status": "ok"
}

Body

Body Type: application/x-www-form-urlencoded
  • name - string (Name of the new event) - Required
  • start - datetime (ISO8601) (Start date and time of event) - Required
  • end - datetime (ISO8601) (End date and time of event) - Required
  • desc - textarea (Description of event)
  • recur - boolean (Set whether the event recurs or not)
  • recurFrequency - integer (Sets the frequency of the event's recurrence (0 = daily, 1 = weekly, 2 = monthly, 3 = yearly))
  • recurInterval - integer (Sets the interval between two occurrences of the same event)
  • recurUntil - date (ISO8601) (Sets when the recurring event stops its recurrence)

Try it out

POST calendar/events/delete

Suggest changes to this endpoint's documentation with GitHub

Deletes an event on the calendar.

Sample Response

{
	"status": "ok"
}

Body

Body Type: application/x-www-form-urlencoded
  • id - integer (ID number of the event to delete) - Required

Try it out

POST calendar/events/edit

Suggest changes to this endpoint's documentation with GitHub

Edits an event on the calendar.

Sample Response

{
	"status": "ok"
}

Body

Body Type: application/x-www-form-urlencoded
  • id - integer (ID number of the event to edit) - Required
  • name - string (Updated name of event) - Required
  • start - datetime (ISO8601) (Updated start date and time of event) - Required
  • end - datetime (ISO8601) (Updated end date and time of event) - Required
  • desc - textarea (Updated description of event)
  • recur - boolean (Set whether the event recurs or not)
  • recurFrequency - integer (Sets the frequency of the event's recurrence (0 = daily, 1 = weekly, 2 = monthly, 3 = yearly))
  • recurInterval - integer (Sets the interval between two occurrences of the same event)
  • recurUntil - date (ISO8601) (Sets when the recurring event stops its recurrence)

Try it out

GET calendar/events/getWeek/:monday

Suggest changes to this endpoint's documentation with GitHub

This API is deprecated and should not be used. See /calendar/getView for a better alternative.

Gets a calendar view for the specified week. :monday is a URL parameter for the ISO8601 date of the monday of the week.

Sample Response

Due to the length of this snippet, it has been collapsed. Click “Expand code” to expand it.

Expand code...
{
	"status": "ok",
	"announcements": [],
	"events": [],
	"hwEvents": [],
	"scheduleEvents": [
		[
			{
				"id": 200,
				"termId": -1,
				"classId": 108778111,
				"name": "HS House - Neiers/Phillips",
				"ownerId": -1,
				"ownerName": "John Neiers",
				"dayNumber": 1,
				"block": "S",
				"buildingName": "108 E. 89th St.",
				"roomNumber": "301",
				"start": 35400,
				"end": 36300,
				"userId": 1
			},
			{
				"id": 272,
				"termId": 97372,
				"classId": 108471529,
				"name": "Environmental Science: Resources - 3335-01 (B)",
				"ownerId": 2615842,
				"ownerName": "Evie Harrison",
				"dayNumber": 1,
				"block": "B",
				"buildingName": "108 E. 89th St.",
				"roomNumber": "1204",
				"start": 29400,
				"end": 32100,
				"userId": 1
			},
			{
				"id": 273,
				"termId": 97372,
				"classId": 108472098,
				"name": "Topics in World History III: The 20th Century - 3520-03 (F)",
				"ownerId": 3456065,
				"ownerName": "Parul Kalbag",
				"dayNumber": 1,
				"block": "F",
				"buildingName": "108 E. 89th St.",
				"roomNumber": "311",
				"start": 39600,
				"end": 42300,
				"userId": 1
			},
			{
				"id": 274,
				"termId": 97372,
				"classId": 108640992,
				"name": "Physical Education - 3903-05 (I)",
				"ownerId": 4791666,
				"ownerName": "Amber Atlas",
				"dayNumber": 1,
				"block": "I",
				"buildingName": "Physical Education Center",
				"roomNumber": "X87",
				"start": 42600,
				"end": 45300,
				"userId": 1
			},
			{
				"id": 275,
				"termId": 97372,
				"classId": 108471759,
				"name": "Precalculus 1 'A' - 3024-02 (H)",
				"ownerId": 5334315,
				"ownerName": "Tao Wang",
				"dayNumber": 1,
				"block": "H",
				"buildingName": "108 E. 89th St.",
				"roomNumber": "503",
				"start": 49200,
				"end": 51900,
				"userId": 1
			},
			{
				"id": 276,
				"termId": 97372,
				"classId": 108697376,
				"name": "Adv. Data Structures and Algorithms 'A' - 3432-03 (G)",
				"ownerId": 4841198,
				"ownerName": "Thomas Armstrong",
				"dayNumber": 1,
				"block": "G",
				"buildingName": "108 E. 89th St.",
				"roomNumber": "504",
				"start": 52200,
				"end": 54900,
				"userId": 1
			}
		],
		[
			{
				"id": 234,
				"termId": -1,
				"classId": 108778111,
				"name": "HS House - Neiers/Phillips",
				"ownerId": -1,
				"ownerName": "John Neiers",
				"dayNumber": 2,
				"block": "S",
				"buildingName": "108 E. 89th St.",
				"roomNumber": "301",
				"start": 35400,
				"end": 36300,
				"userId": 1
			},
			{
				"id": 265,
				"termId": 97372,
				"classId": 108471856,
				"name": "Mandarin Chinese 3 - 3122-01 (C)",
				"ownerId": 5327271,
				"ownerName": "Tzuchih Chien",
				"dayNumber": 2,
				"block": "C",
				"buildingName": "108 E. 89th St.",
				"roomNumber": "252",
				"start": 29400,
				"end": 32100,
				"userId": 1
			},
			{
				"id": 266,
				"termId": 97372,
				"classId": 108471731,
				"name": "AMLIT: Self, Society and Cosmos - 3232-01 (D)",
				"ownerId": 586333,
				"ownerName": "Andrew Glassman",
				"dayNumber": 2,
				"block": "D",
				"buildingName": "108 E. 89th St.",
				"roomNumber": "203",
				"start": 32400,
				"end": 35100,
				"userId": 1
			},
			{
				"id": 267,
				"termId": 97372,
				"classId": 108471759,
				"name": "Precalculus 1 'A' - 3024-02 (H)",
				"ownerId": 5334315,
				"ownerName": "Tao Wang",
				"dayNumber": 2,
				"block": "H",
				"buildingName": "108 E. 89th St.",
				"roomNumber": "503",
				"start": 36600,
				"end": 39300,
				"userId": 1
			},
			{
				"id": 268,
				"termId": 97372,
				"classId": 108697376,
				"name": "Adv. Data Structures and Algorithms 'A' - 3432-03 (G)",
				"ownerId": 4841198,
				"ownerName": "Thomas Armstrong",
				"dayNumber": 2,
				"block": "G",
				"buildingName": "108 E. 89th St.",
				"roomNumber": "504",
				"start": 39600,
				"end": 42300,
				"userId": 1
			},
			{
				"id": 269,
				"termId": 97372,
				"classId": 108471565,
				"name": "College Group Meeting 11 - 3652-07 (K)",
				"ownerId": 4742430,
				"ownerName": "Elise Rodriguez",
				"dayNumber": 2,
				"block": "K",
				"buildingName": "108 E. 89th St.",
				"roomNumber": "301",
				"start": 45600,
				"end": 48900,
				"userId": 1
			},
			{
				"id": 270,
				"termId": 97372,
				"classId": 108471529,
				"name": "Environmental Science: Resources - 3335-01 (B)",
				"ownerId": 2615842,
				"ownerName": "Evie Harrison",
				"dayNumber": 2,
				"block": "B",
				"buildingName": "108 E. 89th St.",
				"roomNumber": "1204",
				"start": 49200,
				"end": 51900,
				"userId": 1
			},
			{
				"id": 271,
				"termId": 97372,
				"classId": 108472052,
				"name": "Robotics - 3410-04 (A)",
				"ownerId": 3313989,
				"ownerName": "Sloan Warren",
				"dayNumber": 2,
				"block": "A",
				"buildingName": "108 E. 89th St.",
				"roomNumber": "502",
				"start": 52200,
				"end": 54900,
				"userId": 1
			}
		],
		[
			{
				"id": 240,
				"termId": -1,
				"classId": 108778111,
				"name": "HS House - Neiers/Phillips",
				"ownerId": -1,
				"ownerName": "John Neiers",
				"dayNumber": 3,
				"block": "S",
				"buildingName": "108 E. 89th St.",
				"roomNumber": "301",
				"start": 35400,
				"end": 36300,
				"userId": 1
			},
			{
				"id": 253,
				"termId": 97372,
				"classId": 108472098,
				"name": "Topics in World History III: The 20th Century - 3520-03 (F)",
				"ownerId": 3456065,
				"ownerName": "Parul Kalbag",
				"dayNumber": 3,
				"block": "F",
				"buildingName": "108 E. 89th St.",
				"roomNumber": "311",
				"start": 32400,
				"end": 35100,
				"userId": 1
			},
			{
				"id": 254,
				"termId": 97372,
				"classId": 108471759,
				"name": "Precalculus 1 'A' - 3024-02 (H)",
				"ownerId": 5334315,
				"ownerName": "Tao Wang",
				"dayNumber": 3,
				"block": "H",
				"buildingName": "108 E. 89th St.",
				"roomNumber": "503",
				"start": 36600,
				"end": 39300,
				"userId": 1
			},
			{
				"id": 255,
				"termId": 97372,
				"classId": 108697376,
				"name": "Adv. Data Structures and Algorithms 'A' - 3432-03 (G)",
				"ownerId": 4841198,
				"ownerName": "Thomas Armstrong",
				"dayNumber": 3,
				"block": "G",
				"buildingName": "108 E. 89th St.",
				"roomNumber": "504",
				"start": 39600,
				"end": 42300,
				"userId": 1
			},
			{
				"id": 256,
				"termId": 97372,
				"classId": 109224926,
				"name": "Web Engineering - 3434-06 (I)",
				"ownerId": 2517567,
				"ownerName": "Charles Forster Stewert",
				"dayNumber": 3,
				"block": "I",
				"buildingName": "108 E. 89th St.",
				"roomNumber": "504",
				"start": 42600,
				"end": 45300,
				"userId": 1
			},
			{
				"id": 257,
				"termId": 97372,
				"classId": 108471731,
				"name": "AMLIT: Self, Society and Cosmos - 3232-01 (D)",
				"ownerId": 586333,
				"ownerName": "Andrew Glassman",
				"dayNumber": 3,
				"block": "D",
				"buildingName": "108 E. 89th St.",
				"roomNumber": "203",
				"start": 47100,
				"end": 49800,
				"userId": 1
			},
			{
				"id": 258,
				"termId": 97372,
				"classId": 108471856,
				"name": "Mandarin Chinese 3 - 3122-01 (C)",
				"ownerId": 5327271,
				"ownerName": "Tzuchih Chien",
				"dayNumber": 3,
				"block": "C",
				"buildingName": "108 E. 89th St.",
				"roomNumber": "252",
				"start": 50100,
				"end": 52800,
				"userId": 1
			},
			{
				"id": 259,
				"termId": 97372,
				"classId": 108641002,
				"name": "Physical Education - 3903-10 (Z)",
				"ownerId": 4791666,
				"ownerName": "Amber Atlas",
				"dayNumber": 3,
				"block": "Z",
				"buildingName": "Physical Education Center",
				"roomNumber": "X87",
				"start": 55800,
				"end": 63000,
				"userId": 1
			}
		],
		[
			{
				"id": 207,
				"termId": -1,
				"classId": 108778111,
				"name": "HS House - Neiers/Phillips",
				"ownerId": -1,
				"ownerName": "John Neiers",
				"dayNumber": 4,
				"block": "S",
				"buildingName": "108 E. 89th St.",
				"roomNumber": "301",
				"start": 35400,
				"end": 36300,
				"userId": 1
			},
			{
				"id": 210,
				"termId": -1,
				"classId": 108778111,
				"name": "Assembly",
				"ownerId": -1,
				"ownerName": "John Neiers",
				"dayNumber": 4,
				"block": "S",
				"buildingName": "108 E. 89th St.",
				"roomNumber": "Theater",
				"start": 42600,
				"end": 46200,
				"userId": 1
			},
			{
				"id": 260,
				"termId": 97372,
				"classId": 108471529,
				"name": "Environmental Science: Resources - 3335-01 (B)",
				"ownerId": 2615842,
				"ownerName": "Evie Harrison",
				"dayNumber": 4,
				"block": "B",
				"buildingName": "108 E. 89th St.",
				"roomNumber": "1204",
				"start": 29400,
				"end": 32100,
				"userId": 1
			},
			{
				"id": 261,
				"termId": 97372,
				"classId": 108472052,
				"name": "Robotics - 3410-04 (A)",
				"ownerId": 3313989,
				"ownerName": "Sloan Warren",
				"dayNumber": 4,
				"block": "A",
				"buildingName": "108 E. 89th St.",
				"roomNumber": "502",
				"start": 32400,
				"end": 35100,
				"userId": 1
			},
			{
				"id": 262,
				"termId": 97372,
				"classId": 108471731,
				"name": "AMLIT: Self, Society and Cosmos - 3232-01 (D)",
				"ownerId": 586333,
				"ownerName": "Andrew Glassman",
				"dayNumber": 4,
				"block": "D",
				"buildingName": "108 E. 89th St.",
				"roomNumber": "203",
				"start": 36600,
				"end": 39300,
				"userId": 1
			},
			{
				"id": 263,
				"termId": 97372,
				"classId": 108471856,
				"name": "Mandarin Chinese 3 - 3122-01 (C)",
				"ownerId": 5327271,
				"ownerName": "Tzuchih Chien",
				"dayNumber": 4,
				"block": "C",
				"buildingName": "108 E. 89th St.",
				"roomNumber": "252",
				"start": 39600,
				"end": 42300,
				"userId": 1
			},
			{
				"id": 264,
				"termId": 97372,
				"classId": 108472098,
				"name": "Topics in World History III: The 20th Century - 3520-03 (F)",
				"ownerId": 3456065,
				"ownerName": "Parul Kalbag",
				"dayNumber": 4,
				"block": "F",
				"buildingName": "108 E. 89th St.",
				"roomNumber": "311",
				"start": 52200,
				"end": 54900,
				"userId": 1
			}
		],
		null
	]
}

Body

This request does not accept a body

Try it out

GET calendar/getStatus

Suggest changes to this endpoint's documentation with GitHub

This API is deprecated and should not be used.

Checks to see if the user has enabled the calendar. Returns a statusNum.

  • statusNum == 0 - Calendar is not imported.
  • statusNum == 1 - Calendar requires re-importing.
  • statusNum == 2 - Calendar is setup and ready to go.

Sample Response

{
	"status": "ok",
	"statusNum": 1
}

Body

This request does not accept a body

Try it out

GET calendar/getView

Suggest changes to this endpoint's documentation with GitHub

Fetches the calendar view for a given range.

Event tags

Some events may contain more data than just the name, start, and end. This is referred to as an event’s metadata and is stored in the tags object of an event. The tags objects is a key-value store, where the keys are numeric and correspond to different information that may be stored with an event. For example, a Homework event may have a tags object that looks like this, where 2 is the number that corresponds to the “homework” tag:

"tags": {
	"2": {
		"id": 24,
		"name": "Read next chapter",
		"due": "2019-05-23",
		"desc": "",
		"complete": 0,
		"classId": 3,
		"userId": 1
	}
}

While a given tag may not be present on all events, if it is present, it is guaranteed to be the correct type. For example, the “building name” tag will, if present, always be a string. See the sample response below for more examples. A full list of tags is below:

name numeric value description
Reserved for future use 0 (reserved)
Description 1 string: A description associated with the event.
Homework 2 object: A homework item associated with the event.
Term ID 3 int: The Term ID associated with the event. Currently only used by the schedule provider for The Dalton School.
Class ID 4 int: The Class ID associated with the event. Currently only used by the schedule provider for The Dalton School.
Owner ID 5 int: The ID of the event’s owner, such as a class’s instructor.
Owner name 6 string: The name of the event’s owner, such as a class’s instructor.
Day number 7 int: The day number associated with the event. Currently only used by the schedule provider for The Dalton School.
Block 8 string: The scheduling block or period associated with the event.
Building name 9 string: The building name of the event.
Room number 10 string: The room number of the event.
Location 11 string: The location of the event.
Read-only 12 boolean: If true, this event cannot be edited directly. It may still be possible to cancel the event or apply certain modifications.
Short name 13 string: A short name of the event, suitable for display in a week or month view.
Actions 14 object[]: Actions associated with the event, such as relevant external links.
Cancelled 15 boolean: If true, this event has been marked as cancelled, and should be displayed as such.
Cancelable 16 boolean: If true, this event can be cancelled by the user.
Section 17 string: The class section.
Original start 18 int: (only for recurring events) The start time of the original event.
Original end 19 int: (only for recurring events) The end time of the original event.
Hide building name 20 boolean: If true, the schedule provider is suggesting that the building name be hidden from certain calendar views. Currently only used by the schedule provider for The Dalton School, where almost all classes happen in the same building.
Homework class 21 object: If the event is associated with a homework item, this is set to the class associated with the homework item.
Instance start 22 int: The start time of the instance of this event. This is mostly the same as the event’s start field; however, if an event spans multiple days, it will be broken into chunks with limited start and end values. (and you can then look at this tag to determine the full span of the event)
Instance end 23 int: Same as above, but for the end of the instance of the event.
Is continuation 24 boolean: If true, this event is a continuation of the same event from the previous day.
Continues 25 boolean: If true, this event continues into the next day.

Sample Response

Due to the length of this snippet, it has been collapsed. Click “Expand code” to expand it.

Expand code...

{
  "status": "ok",
  "view": {
    "providers": [
      {
        "name": "The Dalton School Schedule"
      }
    ],
    "days": [
      {
        "day": "2019-03-11",
        "announcements": [],
        "events": [
          {
            "id": 1689,
            "name": "Computer Science",
            "start": 1552329000,
            "end": 1552331700,
            "recurRule": null,
            "tags": {
              "3": 97372,
              "4": 108697389,
              "5": 1320694,
              "6": "Sample Teacher",
              "7": 1,
              "8": "G",
              "9": "108 E. 89th St.",
              "10": "502"
            },
            "source": 0,
            "userId": 1
          }
        ]
      },
      {
        "day": "2019-03-12",
        "announcements": [],
        "events": [
          {
            "id": 1665,
            "name": "Physics",
            "start": 1552399800,
            "end": 1552405500,
            "recurRule": null,
            "tags": {
              "3": 97372,
              "4": 108471973,
              "5": 586292,
              "6": "Sample Teacher",
              "7": 2,
              "8": "H",
              "9": "108 E. 89th St.",
              "10": "1205"
            },
            "source": 0,
            "userId": 1
          }
        ]
      },
      {
        "day": "2019-03-13",
        "announcements": [],
        "events": [
          {
            "id": 1691,
            "name": "Math",
            "start": 1552492200,
            "end": 1552494900,
            "recurRule": null,
            "tags": {
              "3": 97372,
              "4": 108644631,
              "5": 586462,
              "6": "Sample Teacher",
              "7": 3,
              "8": "I",
              "9": "108 E. 89th St.",
              "10": "503"
            },
            "source": 0,
            "userId": 1
          }
        ]
      },
      {
        "day": "2019-03-14",
        "announcements": [],
        "events": [
          {
            "id": 1697,
            "name": "Robotics",
            "start": 1552572600,
            "end": 1552575300,
            "recurRule": null,
            "tags": {
              "3": 97372,
              "4": 108472048,
              "5": 3313989,
              "6": "Sample Teacher",
              "7": 4,
              "8": "D",
              "9": "108 E. 89th St.",
              "10": "502"
            },
            "source": 0,
            "userId": 1
          }
        ]
      },
      {
        "day": "2019-03-15",
        "announcements": [
          {
            "id": -1,
            "date": "2019-03-15",
            "text": "Friday 4",
            "grade": -1,
            "type": 0
          }
        ],
        "events": [
          {
            "id": 1702,
            "name": "History",
            "start": 1552651800,
            "end": 1552654500,
            "recurRule": null,
            "tags": {
              "3": 97372,
              "4": 108569265,
              "5": 4791732,
              "6": "Sample Teacher",
              "7": 8,
              "8": "C",
              "9": "108 E. 89th St.",
              "10": "350"
            },
            "source": 0,
            "userId": 1
          }
        ]
      },
      {
        "day": "2019-03-16",
        "announcements": [
          {
            "id": 127,
            "date": "2019-03-16",
            "text": "Start of Spring Recess",
            "grade": 0,
            "type": 2
          }
        ],
        "events": [
          {
            "id": 8,
            "name": "Some important event",
            "start": 1552761900,
            "end": 1552763700,
            "recurRule": null,
            "tags": {
              "1": ""
            },
            "source": -1,
            "userId": 1
          },
          {
            "id": 1,
            "name": "Read next chapter",
            "start": 1552756500,
            "end": 1552759200,
            "recurRule": null,
            "tags": {
              "2": {
                "id": 24,
                "name": "Read next chapter",
                "due": "2019-05-23",
                "desc": "",
                "complete": 0,
                "classId": 3,
                "userId": 1
              }
            },
            "source": -1,
            "userId": 1
          }
        ]
      },
      {
        "day": "2019-03-17",
        "announcements": [
          {
            "id": 127,
            "date": "2019-03-17",
            "text": "Spring Recess",
            "grade": 0,
            "type": 2
          }
        ],
        "events": []
      }
    ]
  }
}
</pre></details>

Body

Body Type: application/x-www-form-urlencoded
  • start - date (ISO8601) (Inclusive start date of calendar view) - Required
  • end - date (ISO8601) (Exclusive end date of calendar view) - Required

Try it out

POST calendar/hwEvents/add

Suggest changes to this endpoint's documentation with GitHub

Adds an event to the calendar from homework.

Sample Response

{
	"status": "ok"
}

Body

Body Type: application/x-www-form-urlencoded
  • homeworkId - integer (ID number of the homework assignment that the calendar event is being made for) - Required
  • start - datetime (ISO8601) (Start date and time of event) - Required
  • end - datetime (ISO8601) (End date and time of event) - Required

Try it out

POST calendar/hwEvents/delete

Suggest changes to this endpoint's documentation with GitHub

Edits a homework event on the calendar.

Sample Response

{
	"status": "ok"
}

Body

Body Type: application/x-www-form-urlencoded
  • id - integer (ID number calendar event to delete) - Required

Try it out

POST calendar/hwEvents/edit

Suggest changes to this endpoint's documentation with GitHub

Edits a homework event on the calendar.

Sample Response

{
	"status": "ok"
}

Body

Body Type: application/x-www-form-urlencoded
  • id - integer (ID number calendar event to edit) - Required
  • homeworkId - integer (Updated ID number of homework corresponding to event) - Required
  • start - datetime (ISO8601) (Updated start date and time of event) - Required
  • end - datetime (ISO8601) (Updated end date and time of event) - Required

Try it out

POST calendar/import

Suggest changes to this endpoint's documentation with GitHub

Imports a user’s schedule into MyHomeworkSpace

Sample Response

{
	"status": "ok"
}

Body

Body Type: application/x-www-form-urlencoded
  • password - string (User's Dalton Password. Note that this is sensitive data and is not stored by MyHomeworkSpace. If you choose to store this data, it should be stored securely.) - Required

Try it out

POST calendar/resetSchedule

Suggest changes to this endpoint's documentation with GitHub

Removes a user’s schedule from MyHomeworkSpace. Though this disables Calendar view, it does not remove events manually added to the calendar by the user. To view those events, the user’s schedule needs to be reimported.

Sample Response

{
	"status": "ok"
}

Body

This request does not accept a body

Try it out

POST classes/delete

Suggest changes to this endpoint's documentation with GitHub

Deletes a class.

Sample Response

{
	"status": "ok"
}

Body

Body Type: application/x-www-form-urlencoded
  • id - integer (Unique id of the class to delete) - Required

Try it out

POST classes/edit

Suggest changes to this endpoint's documentation with GitHub

Updates a class.

Sample Response

{
	"status": "ok"
}

Body

Body Type: application/x-www-form-urlencoded
  • id - integer (Unique id of the class to update) - Required
  • name - string (Updated name of the class) - Required
  • color - hexadecimal color (without \#) (Updated color of the class) - Required
  • teacher - string (Updated name of the teacher of the class)

Try it out

GET classes/get/:id

Suggest changes to this endpoint's documentation with GitHub

Gets information about a particular class. :id is a URL parameter for the unique id of that class.

Sample Response

{
	"status": "ok",
	"class": {
		"id": 1,
		"name": "Science",
		"teacher": "",
		"color": "ffa540",
		"userId": -1
	}
}

Body

This request does not accept a body

Try it out

GET classes/get

Suggest changes to this endpoint's documentation with GitHub

Gets a list of classes.

Sample Response

{
	"status": "ok",
	"classes": [
		{
			"id": 1,
			"name": "Science",
			"teacher": "",
			"color": "ffa540",
			"userId": -1
		},
		{
			"id": 2,
			"name": "History",
			"teacher": "",
			"color": "40ff73",
			"userId": -1
		},
		{
			"id": 3,
			"name": "English",
			"teacher": "",
			"color": "4071ff",
			"userId": -1
		}
	]
}

Body

This request does not accept a body

Try it out

GET classes/hwInfo/:id

Suggest changes to this endpoint's documentation with GitHub

Returns the number of homework assignments in a particular class (this includes completed assignments and assignments whose due dates have passed). :id is a URL parameter for the ID of the class.

Sample Response

{
	"status": "ok",
	"hwItems": 2
}

Body

This request does not accept a body

Try it out

POST classes/swap

Suggest changes to this endpoint's documentation with GitHub

Swaps two classes positions in the planner.

Sample Response

{
	"status": "ok"
}

Body

Body Type: application/x-www-form-urlencoded
  • id1 - integer (Unique id of the first class) - Required
  • id2 - integer (Unique id of the second class) - Required

Try it out

POST classes/add

Suggest changes to this endpoint's documentation with GitHub

Creates a new class.

Sample Response

{
	"status": "ok"
}

Body

Body Type: application/x-www-form-urlencoded
  • name - string (Name of the new class) - Required
  • color - hexadecimal color (without \#) (Color of the new class) - Required
  • teacher - string (Name of the teacher of the new class)

Try it out

POST feedback/add

Suggest changes to this endpoint's documentation with GitHub

Adds feedback for administrators to view.

Sample Response

{
	"status": "ok"
}

Body

Body Type: application/x-www-form-urlencoded
  • type - string (\"smile", "frown", or "idea") - Required
  • text - text (0 or 1) - Required
  • screenshot - base64 png data url (screenshot of issue)

Try it out

POST homework/add

Suggest changes to this endpoint's documentation with GitHub

Creates a new homework assignment

Sample Response

{
	"status": "ok"
}

Body

Body Type: application/x-www-form-urlencoded
  • name - string (Name of the homework) - Required
  • due - date (ISO8601) (Due date of the homework) - Required
  • complete - 1 or 0 (1 if the homework is completed, 0 if the homework is not completed) - Required
  • classId - integer (Unique id of the class that the homework is in) - Required
  • desc - text (Description of the homework)

Try it out

POST homework/delete

Suggest changes to this endpoint's documentation with GitHub

Body

Body Type: application/x-www-form-urlencoded
  • id - integer (Unique id of the homework to delete) - Required

Try it out

POST homework/edit

Suggest changes to this endpoint's documentation with GitHub

Edits a homework assignment

Sample Response

{
	"status": "ok"
}

Body

Body Type: application/x-www-form-urlencoded
  • id - integer (Unique id of the homework to edit) - Required
  • name - string (Updated name of the homework) - Required
  • due - date (ISO8601) (Updated due date of the homework) - Required
  • complete - 1 or 0 (1 if the homework is completed, 0 if the homework is not completed) - Required
  • classId - integer (Updated unique id of the class that the homework is in) - Required
  • desc - text (Updated description of the homework)

Try it out

GET homework/get/:id

Suggest changes to this endpoint's documentation with GitHub

Gets a homework assignment with a specific id. Note that :id is a URL parameter for the id of the homework to get.

Sample Response

{
	"status": "ok",
	"homework": {
		"id": 1,
		"name": "HW 1",
		"due": "2019-02-14",
		"desc": "",
		"complete": 0,
		"classId": 1,
		"userId": 1
	}
}

Body

This request does not accept a body

Try it out

GET homework/get

Suggest changes to this endpoint's documentation with GitHub

Gets all homework for an account

Sample Response

{
	"status": "ok",
	"homework": [
		{
			"id": 3,
			"name": "HW ",
			"due": "2019-02-06",
			"desc": "",
			"complete": 1,
			"classId": 1,
			"userId": 1
		},
		{
			"id": 1,
			"name": "HW 1",
			"due": "2019-02-14",
			"desc": "",
			"complete": 0,
			"classId": 1,
			"userId": 1
		},
		{
			"id": 2,
			"name": "Essay Nuclear Energy",
			"due": "2019-02-15",
			"desc": "",
			"complete": 0,
			"classId": 1,
			"userId": 1
		}
	]
}

Body

This request does not accept a body

Try it out

GET homework/getForClass/:id

Suggest changes to this endpoint's documentation with GitHub

Gets all homework for a particular class. Note that :id is a URL parameter for the class to get the homework for.

Sample Response

{
	"status": "ok",
	"homework": [
		{
			"id": 3,
			"name": "HW ",
			"due": "2019-02-06",
			"desc": "",
			"complete": 1,
			"classId": 1,
			"userId": 1
		},
		{
			"id": 1,
			"name": "HW 1",
			"due": "2019-02-14",
			"desc": "",
			"complete": 0,
			"classId": 1,
			"userId": 1
		},
		{
			"id": 2,
			"name": "Essay Nuclear Energy",
			"due": "2019-02-15",
			"desc": "",
			"complete": 0,
			"classId": 1,
			"userId": 1
		}
	]
}

Body

This request does not accept a body

Try it out

GET homework/getHWView

Suggest changes to this endpoint's documentation with GitHub

Gets the user’s active homework

Sample Response

{
	"status": "ok",
	"homework": [
		{
			"id": 1,
			"name": "HW 1",
			"due": "2019-02-14",
			"desc": "",
			"complete": 0,
			"classId": 1,
			"userId": 1
		},
		{
			"id": 2,
			"name": "Essay Nuclear Energy",
			"due": "2019-02-15",
			"desc": "",
			"complete": 0,
			"classId": 1,
			"userId": 1
		}
	]
}

Body

This request does not accept a body

Try it out

GET homework/getHWViewSorted

Suggest changes to this endpoint's documentation with GitHub

Gets a sorted version of Homework

Sample Response

{
	"status": "ok",
	"tomorrowName": "Tomorrow",
	"showToday": false,
	"overdue": [
		{
			"id": 1,
			"name": "HW 1",
			"due": "2019-02-14",
			"desc": "",
			"complete": 0,
			"classId": 1,
			"userId": 1
		}
	],
	"today": [],
	"tomorrow": [
		{
			"id": 2,
			"name": "Essay Nuclear Energy",
			"due": "2019-02-15",
			"desc": "",
			"complete": 0,
			"classId": 1,
			"userId": 1
		}
	],
	"soon": [],
	"longterm": []
}

Body

This request does not accept a body

Try it out

GET homework/getPickerSuggestions

Suggest changes to this endpoint's documentation with GitHub

Gets a few suggestions for homework assignments to add to calendar.

Sample Response

{
	"status": "ok",
	"homework": [
		{
			"id": 2,
			"name": "Essay Nuclear Energy",
			"due": "2019-02-15",
			"desc": "",
			"complete": 0,
			"classId": 1,
			"userId": 1
		}
	]
}

Body

This request does not accept a body

Try it out

GET homework/getWeek/:date

Suggest changes to this endpoint's documentation with GitHub

Gets all homework for a particular week. :date is a URL parameter for the first date of the week being queried, in ISO8601 format.

Sample Response

{
	"status": "ok",
	"homework": [
		{
			"id": 1,
			"name": "HW 1",
			"due": "2019-02-14",
			"desc": "",
			"complete": 0,
			"classId": 1,
			"userId": 1
		},
		{
			"id": 2,
			"name": "Essay Nuclear Energy",
			"due": "2019-02-15",
			"desc": "",
			"complete": 0,
			"classId": 1,
			"userId": 1
		}
	]
}

Body

This request does not accept a body

Try it out

POST homework/markOverdueDone

Suggest changes to this endpoint's documentation with GitHub

Marks all overdue assignments as done.

Sample Response

{
	"status": "ok"
}

Body

This request does not accept a body

Try it out

Suggest changes to this endpoint's documentation with GitHub

Searches for a homework assignment.

Sample Response

{
	"status": "ok",
	"homework": [
		{
			"id": 2,
			"name": "Essay Nuclear Energy",
			"due": "2019-02-15",
			"desc": "",
			"complete": 0,
			"classId": 1,
			"userId": 1
		}
	]
}

Body

This request does not accept a body

Try it out

POST notifications/add

Suggest changes to this endpoint's documentation with GitHub

Adds a notification to MyHomeworkSpace. Note that this call requires a user.level >= 1.

Sample Response

{
	"status": "ok"
}

Body

Body Type: application/x-www-form-urlencoded
  • content - string (Content of the notification) - Required
  • expiry - Date (ISO8601) (Date that the notification expires.) - Required

Try it out

POST notifications/add

Suggest changes to this endpoint's documentation with GitHub

Deletes a notification from MyHomeworkSpace. Note that this call requires a user.level >= 1.

Sample Response

{
	"status": "ok"
}

Body

This request does not accept a body

Try it out

GET notifications/get

Suggest changes to this endpoint's documentation with GitHub

Gets active notifications.

Sample Response

{
	"status": "ok",
	"notifications": [
		{
			"id": 1,
			"content": "Happy winter!",
			"expiry": "2019-02-15"
		},
		{
			"id": 2,
			"content": "Hi!",
			"expiry": "2019-03-01"
		}
	]
}

Body

This request does not accept a body

Try it out

GET planner/getWeekInfo/:date

Suggest changes to this endpoint's documentation with GitHub

Gets the planner announcements for a given week. :date is a URL parameter for the first date of the week being queried, in ISO8601 format.

Sample Response

{
    "status": "ok",
    "announcements": [
        {
            "id": 1,
            "date": "2019-02-15",
            "text": "Super important day",
            "grade": 0,
            "type": 0
        }
    ]
}

Body

This request does not accept a body

Try it out

POST prefixes/add

Suggest changes to this endpoint's documentation with GitHub

Creates a tag.

Sample Response

{
	"status": "ok"
}

Body

Body Type: application/x-www-form-urlencoded
  • color - hexadecimal color (without /#) (Text color in tag) - Required
  • background - hexadecimal color (without /#) (Background color in tag) - Required
  • words - JSON array of strings (Words to be used be used as prefixes) - Required
  • timedEvent - bool (true if the event is timed (like a quiz, test, or lab) or false if the event is not timed (like a homework or take home test)) - Required

Try it out

POST prefixes/delete

Suggest changes to this endpoint's documentation with GitHub

Deletes a tag.

Sample Response

{
	"status": "ok"
}

Body

Body Type: application/x-www-form-urlencoded
  • id - integer (Unique id of the tag to delete) - Required

Try it out

GET prefixes/getDefaultList

Suggest changes to this endpoint's documentation with GitHub

Gets all the default tags for new MyHomeworkSpace accounts.

Sample Response

Due to the length of this snippet, it has been collapsed. Click “Expand code” to expand it.

Expand code...

{
	"status": "ok",
	"prefixes": [
		{
			"id": -1,
			"background": "4C6C9B",
			"color": "FFFFFF",
			"words": [
				"HW",
				"Read",
				"Reading"
			],
			"timedEvent": false,
			"default": true
		},
		{
			"id": -1,
			"background": "9ACD32",
			"color": "FFFFFF",
			"words": [
				"Project"
			],
			"timedEvent": false,
			"default": true
		},
		{
			"id": -1,
			"background": "C3A528",
			"color": "FFFFFF",
			"words": [
				"Report",
				"Essay",
				"Paper",
				"Write"
			],
			"timedEvent": false,
			"default": true
		},
		{
			"id": -1,
			"background": "FFA500",
			"color": "FFFFFF",
			"words": [
				"Quiz",
				"PopQuiz",
				"GradedHW",
				"GradedHomework"
			],
			"timedEvent": false,
			"default": true
		},
		{
			"id": -1,
			"background": "DC143C",
			"color": "FFFFFF",
			"words": [
				"Test",
				"Final",
				"Exam",
				"Midterm",
				"Ahh"
			],
			"timedEvent": false,
			"default": true
		},
		{
			"id": -1,
			"background": "2AC0F1",
			"color": "FFFFFF",
			"words": [
				"ICA",
				"FieldTrip",
				"Thingy"
			],
			"timedEvent": false,
			"default": true
		},
		{
			"id": -1,
			"background": "2AF15E",
			"color": "FFFFFF",
			"words": [
				"Lab",
				"BookALab",
				"BookLab",
				"Study",
				"Memorize"
			],
			"timedEvent": true,
			"default": true
		},
		{
			"id": -1,
			"background": "003DAD",
			"color": "FFFFFF",
			"words": [
				"DocID"
			],
			"timedEvent": false,
			"default": true
		},
		{
			"id": -1,
			"background": "000000",
			"color": "00FF00",
			"words": [
				"Trojun",
				"Hex"
			],
			"timedEvent": false,
			"default": true
		},
		{
			"id": -1,
			"background": "5000BC",
			"color": "FFFFFF",
			"words": [
				"OptionalHW",
				"Challenge"
			],
			"timedEvent": false,
			"default": true
		},
		{
			"id": -1,
			"background": "000099",
			"color": "FFFFFF",
			"words": [
				"Presentation",
				"Prez"
			],
			"timedEvent": false,
			"default": true
		},
		{
			"id": -1,
			"background": "123456",
			"color": "FFFFFF",
			"words": [
				"BuildSession",
				"Build"
			],
			"timedEvent": true,
			"default": true
		},
		{
			"id": -1,
			"background": "5A1B87",
			"color": "FFFFFF",
			"words": [
				"Meeting",
				"Meet"
			],
			"timedEvent": true,
			"default": true
		},
		{
			"id": -1,
			"background": "01B501",
			"color": "FFFFFF",
			"words": [
				"Begin",
				"Start",
				"Do"
			],
			"timedEvent": true,
			"default": true
		},
		{
			"id": -1,
			"background": "E34000",
			"color": "FFFFFF",
			"words": [
				"Apply",
				"Application",
				"Deadline"
			],
			"timedEvent": false,
			"default": true
		}
	],
	"fallbackBackground": "FFD3BD",
	"fallbackColor": "000000"
}

Body

This request does not accept a body

Try it out

GET prefixes/getList

Suggest changes to this endpoint's documentation with GitHub

Gets the logged in user’s list of tags.

Sample Response

Due to the length of this snippet, it has been collapsed. Click “Expand code” to expand it.

Expand code...

{
	"status": "ok",
	"prefixes": [
		{
			"id": -1,
			"background": "4C6C9B",
			"color": "FFFFFF",
			"words": [
				"HW",
				"Read",
				"Reading"
			],
			"timedEvent": false,
			"default": true
		},
		{
			"id": -1,
			"background": "9ACD32",
			"color": "FFFFFF",
			"words": [
				"Project"
			],
			"timedEvent": false,
			"default": true
		},
		{
			"id": -1,
			"background": "C3A528",
			"color": "FFFFFF",
			"words": [
				"Report",
				"Essay",
				"Paper",
				"Write"
			],
			"timedEvent": false,
			"default": true
		},
		{
			"id": -1,
			"background": "FFA500",
			"color": "FFFFFF",
			"words": [
				"Quiz",
				"PopQuiz",
				"GradedHW",
				"GradedHomework"
			],
			"timedEvent": false,
			"default": true
		},
		{
			"id": -1,
			"background": "DC143C",
			"color": "FFFFFF",
			"words": [
				"Test",
				"Final",
				"Exam",
				"Midterm",
				"Ahh"
			],
			"timedEvent": false,
			"default": true
		},
		{
			"id": -1,
			"background": "2AC0F1",
			"color": "FFFFFF",
			"words": [
				"ICA",
				"FieldTrip",
				"Thingy"
			],
			"timedEvent": false,
			"default": true
		},
		{
			"id": -1,
			"background": "2AF15E",
			"color": "FFFFFF",
			"words": [
				"Lab",
				"BookALab",
				"BookLab",
				"Study",
				"Memorize"
			],
			"timedEvent": true,
			"default": true
		},
		{
			"id": -1,
			"background": "003DAD",
			"color": "FFFFFF",
			"words": [
				"DocID"
			],
			"timedEvent": false,
			"default": true
		},
		{
			"id": -1,
			"background": "000000",
			"color": "00FF00",
			"words": [
				"Trojun",
				"Hex"
			],
			"timedEvent": false,
			"default": true
		},
		{
			"id": -1,
			"background": "5000BC",
			"color": "FFFFFF",
			"words": [
				"OptionalHW",
				"Challenge"
			],
			"timedEvent": false,
			"default": true
		},
		{
			"id": -1,
			"background": "000099",
			"color": "FFFFFF",
			"words": [
				"Presentation",
				"Prez"
			],
			"timedEvent": false,
			"default": true
		},
		{
			"id": -1,
			"background": "123456",
			"color": "FFFFFF",
			"words": [
				"BuildSession",
				"Build"
			],
			"timedEvent": true,
			"default": true
		},
		{
			"id": -1,
			"background": "5A1B87",
			"color": "FFFFFF",
			"words": [
				"Meeting",
				"Meet"
			],
			"timedEvent": true,
			"default": true
		},
		{
			"id": -1,
			"background": "01B501",
			"color": "FFFFFF",
			"words": [
				"Begin",
				"Start",
				"Do"
			],
			"timedEvent": true,
			"default": true
		},
		{
			"id": -1,
			"background": "E34000",
			"color": "FFFFFF",
			"words": [
				"Apply",
				"Application",
				"Deadline"
			],
			"timedEvent": false,
			"default": true
		},
		{
			"id": 1,
			"background": "FF4086",
			"color": "FFFFFF",
			"words": [
				"SATPrep"
			],
			"timedEvent": false,
			"default": false
		},
		{
			"id": 2,
			"background": "4d4d4d",
			"color": "000000",
			"words": [
				"Hospital"
			],
			"timedEvent": false,
			"default": false
		}
	],
	"fallbackBackground": "FFD3BD",
	"fallbac

Body

This request does not accept a body

Try it out

GET prefs/get/:key

Suggest changes to this endpoint's documentation with GitHub

Get a preference.

Sample Response

{
    "status": "ok",
    "pref": {
        "id": 1,
        "key": "disableQuickAdd",
        "value": "true"
    }
}

Body

This request does not accept a body

Try it out

POST prefs/set

Suggest changes to this endpoint's documentation with GitHub

Set a preference.

Sample Response

{
    "status": "ok"
}

Body

Body Type: application/x-www-form-urlencoded
  • key - string (key for preference) - Required
  • value - value for preference (0 or 1) - Required

Try it out

GET status

Suggest changes to this endpoint's documentation with GitHub

Gets the status of the API

Caution! This API call shows the status of the API, and does not return JSON. If the API is alive, it simply returns "Alive"

Sample Response

Alive

Body

This request does not accept a body

Try it out