{"_id":"58c5cb2ed217601900fe9f6c","link_url":"","githubsync":"","api":{"auth":"required","params":[],"url":"","results":{"codes":[{"code":"{}","language":"json","status":200,"name":""},{"name":"","code":"{}","language":"json","status":400}]},"settings":""},"excerpt":"This page will help you get started with the MyHomeworkSpace API. You'll be up and running in a jiffy!","type":"basic","project":"5673fa4a4b2a680d00524eb2","version":"58c5cb2ed217601900fe9f69","createdAt":"2015-12-18T12:21:32.027Z","slug":"getting-started","__v":0,"category":"58c5cb2ed217601900fe9f6a","user":"5673fa1b4b2a680d00524eb1","updates":[],"isReference":false,"body":"Welcome, and thanks for your interest in the MyHomeworkSpace API!\n\nCurrently, there are no helper libraries available. API calls are done via HTTPS (or HTTP if you really want) requests. Your language of choice should be able to decode and encode JSON so you can communicate with the PlanHub server.\n\nAlmost every API call requires a nonce, a special token that can be generated from the [/api/v1/csrf](https://myhwspace.readme.io/docs/apiv1csrf) endpoint. Each request requires its own nonce.\n\n…to be continued…","title":"Get Started with the MyHomeworkSpace API","next":{"pages":[],"description":""},"link_external":false,"sync_unique":"","hidden":false,"order":0,"childrenPages":[]}

Get Started with the MyHomeworkSpace API

This page will help you get started with the MyHomeworkSpace API. You'll be up and running in a jiffy!

Welcome, and thanks for your interest in the MyHomeworkSpace API! Currently, there are no helper libraries available. API calls are done via HTTPS (or HTTP if you really want) requests. Your language of choice should be able to decode and encode JSON so you can communicate with the PlanHub server. Almost every API call requires a nonce, a special token that can be generated from the [/api/v1/csrf](https://myhwspace.readme.io/docs/apiv1csrf) endpoint. Each request requires its own nonce. …to be continued…
Welcome, and thanks for your interest in the MyHomeworkSpace API! Currently, there are no helper libraries available. API calls are done via HTTPS (or HTTP if you really want) requests. Your language of choice should be able to decode and encode JSON so you can communicate with the PlanHub server. Almost every API call requires a nonce, a special token that can be generated from the [/api/v1/csrf](https://myhwspace.readme.io/docs/apiv1csrf) endpoint. Each request requires its own nonce. …to be continued…
{"_id":"58c5cb2ed217601900fe9f6d","title":"MyHomeworkSpace Staging","__v":0,"body":"You can access staging by going to [http://staging2.myhomework.space](http://staging2.myhomework.space). Staging contains the latest changes to MyHomeworkSpace's code, as soon as they are made. While this means you can test your application with the latest features and API changes, it is also not stable. This is why a separate database is used. There may be major bugs, errors, or other issues. We don’t provide support for it—however, if you’ve found an issue, please [tell us](https://github.com/MyHomeworkSpace/client/issues/new)!\n[block:callout]\n{\n  \"type\": \"danger\",\n  \"body\": \"Please do not use staging as a replacement for normal MyHomeworkSpace. There may be major errors, long downtime, or other issues. However, we do recommend testing your application against this version to ensure that your application will not break when the stable version of PlanHub updates.\",\n  \"title\": \"Danger: Do not use staging as a replacement for MyHomeworkSpace\"\n}\n[/block]","category":"58c5cb2ed217601900fe9f6a","hidden":false,"next":{"pages":[],"description":""},"isReference":false,"link_url":"","project":"5673fa4a4b2a680d00524eb2","slug":"myhomeworkspace-staging","type":"basic","user":"5673fa1b4b2a680d00524eb1","createdAt":"2016-03-09T13:36:11.333Z","excerpt":"","githubsync":"","link_external":false,"sync_unique":"","api":{"params":[],"url":"","examples":{"codes":[]},"results":{"codes":[{"code":"{}","language":"json","status":200,"name":""},{"language":"json","status":400,"name":"","code":"{}"}]},"settings":"","auth":"required"},"order":1,"updates":[],"version":"58c5cb2ed217601900fe9f69","childrenPages":[]}

MyHomeworkSpace Staging


You can access staging by going to [http://staging2.myhomework.space](http://staging2.myhomework.space). Staging contains the latest changes to MyHomeworkSpace's code, as soon as they are made. While this means you can test your application with the latest features and API changes, it is also not stable. This is why a separate database is used. There may be major bugs, errors, or other issues. We don’t provide support for it—however, if you’ve found an issue, please [tell us](https://github.com/MyHomeworkSpace/client/issues/new)! [block:callout] { "type": "danger", "body": "Please do not use staging as a replacement for normal MyHomeworkSpace. There may be major errors, long downtime, or other issues. However, we do recommend testing your application against this version to ensure that your application will not break when the stable version of PlanHub updates.", "title": "Danger: Do not use staging as a replacement for MyHomeworkSpace" } [/block]
You can access staging by going to [http://staging2.myhomework.space](http://staging2.myhomework.space). Staging contains the latest changes to MyHomeworkSpace's code, as soon as they are made. While this means you can test your application with the latest features and API changes, it is also not stable. This is why a separate database is used. There may be major bugs, errors, or other issues. We don’t provide support for it—however, if you’ve found an issue, please [tell us](https://github.com/MyHomeworkSpace/client/issues/new)! [block:callout] { "type": "danger", "body": "Please do not use staging as a replacement for normal MyHomeworkSpace. There may be major errors, long downtime, or other issues. However, we do recommend testing your application against this version to ensure that your application will not break when the stable version of PlanHub updates.", "title": "Danger: Do not use staging as a replacement for MyHomeworkSpace" } [/block]
{"_id":"58c5cb2ed217601900fe9f6f","githubsync":"","link_url":"","project":"5673fa4a4b2a680d00524eb2","title":"/csrf/","type":"get","__v":0,"excerpt":"The Nonce Getter","link_external":false,"order":3,"slug":"apiv1csrf","sync_unique":"","updates":[],"createdAt":"2015-12-18T12:40:09.501Z","isReference":false,"hidden":false,"next":{"description":"","pages":[]},"user":"5673fa1b4b2a680d00524eb1","version":"58c5cb2ed217601900fe9f69","api":{"method":"get","params":[],"results":{"codes":[{"language":"json","code":"{\n\t\"status\": \"ok\",\n\t\"version\": \"1\",\n\t\"nonce\": \"ae74b93dd7dfc59190594d2780b86d47\"\n}","name":"","status":200},{"code":"{\n  \"status\":\"error\",\n  \"error\":\"csrfToken_created\"\n}","name":"csrfToken_created","status":"4XX","language":"json"}]},"settings":"","url":"/csrf/","auth":"required","examples":{"codes":[]}},"category":"58c5cb2ed217601900fe9f6b","body":"Use this to get a nonce, which then can be used for making another API request.\n\n#Parameters\nNone.\n\n#Returns\nA JSON object with the following properties:\n\nstatus - `ok` if the operation was successful, or `error` if there was a problem.\nversion - always `1`.\nnonce - a nonce, associated with the current session.\n[block:callout]\n{\n  \"type\": \"danger\",\n  \"title\": \"Running /csrf/\",\n  \"body\": \"You have to call /csrf/ twice, the first time generates a nonce, and the second time gives you the nonce.\"\n}\n[/block]","childrenPages":[]}

get/csrf/

The Nonce Getter

Use this to get a nonce, which then can be used for making another API request. #Parameters None. #Returns A JSON object with the following properties: status - `ok` if the operation was successful, or `error` if there was a problem. version - always `1`. nonce - a nonce, associated with the current session. [block:callout] { "type": "danger", "title": "Running /csrf/", "body": "You have to call /csrf/ twice, the first time generates a nonce, and the second time gives you the nonce." } [/block]

User Information

Try It Out

get
{{ tryResults.results }}
Method{{ tryResults.method }}
Request Headers
{{ tryResults.requestHeaders }}
URL{{ tryResults.url }}
Request Data
{{ tryResults.data }}
Status
Response Headers
{{ tryResults.responseHeaders }}

Definition

{{ api_url }}{{ page_api_url }}

Result Format



Use this to get a nonce, which then can be used for making another API request. #Parameters None. #Returns A JSON object with the following properties: status - `ok` if the operation was successful, or `error` if there was a problem. version - always `1`. nonce - a nonce, associated with the current session. [block:callout] { "type": "danger", "title": "Running /csrf/", "body": "You have to call /csrf/ twice, the first time generates a nonce, and the second time gives you the nonce." } [/block]
{"_id":"58c5cb2ed217601900fe9f70","slug":"apiv1planner","category":"58c5cb2ed217601900fe9f6b","updates":[],"createdAt":"2015-12-18T12:46:25.929Z","sync_unique":"","hidden":false,"api":{"results":{"codes":[{"name":"","code":"{\n\t\"status\": \"ok\",\n\t\"version\": \"1\"\n}","language":"json","status":200}]},"settings":"","auth":"required","params":[],"url":"/planner","examples":{"codes":[]},"method":"get"},"project":"5673fa4a4b2a680d00524eb2","link_external":false,"link_url":"","order":4,"title":"/api/v1/planner","__v":0,"next":{"pages":[],"description":""},"isReference":false,"body":"Check version information of the Planner API. This also can be used to check if the API is available and responding.\n\n#Parameters\nNone.\n\n#Returns\nA JSON object with the following properties:\n\nstatus - always `ok`.\nversion - always `1`.","excerpt":"","user":"5673fa1b4b2a680d00524eb1","version":"58c5cb2ed217601900fe9f69","githubsync":"","type":"get","childrenPages":[]}

get/api/v1/planner


Check version information of the Planner API. This also can be used to check if the API is available and responding. #Parameters None. #Returns A JSON object with the following properties: status - always `ok`. version - always `1`.

User Information

Try It Out

get
{{ tryResults.results }}
Method{{ tryResults.method }}
Request Headers
{{ tryResults.requestHeaders }}
URL{{ tryResults.url }}
Request Data
{{ tryResults.data }}
Status
Response Headers
{{ tryResults.responseHeaders }}

Definition

{{ api_url }}{{ page_api_url }}

Result Format



Check version information of the Planner API. This also can be used to check if the API is available and responding. #Parameters None. #Returns A JSON object with the following properties: status - always `ok`. version - always `1`.
{"_id":"58c5cb2ed217601900fe9f71","githubsync":"","sync_unique":"","api":{"url":"/features/get","examples":{"codes":[]},"method":"get","results":{"codes":[{"code":"{\n\t\"status\": \"ok\",\n\t\"features\": [ \"planner\", \"hwView\" ]\n}","name":"","status":200,"language":"json"},{"name":"","status":400,"language":"json","code":"{\n\t\"status\": \"error\",\n}"}]},"settings":"","auth":"required","params":[]},"order":5,"slug":"apiv1featuresget","version":"58c5cb2ed217601900fe9f69","updates":[],"link_external":false,"type":"get","title":"/api/v1/features/get","isReference":false,"__v":0,"user":"5673fa1b4b2a680d00524eb1","link_url":"","hidden":false,"body":"Gets a list of features enabled on the account.\n\n#Parameters\nNone.\n\n#Returns\nA JSON object with the following properties:\n\nstatus - `ok` if the operation was successful, or `error` if there was a problem.\nfeatures - an array containing a list of features enabled on the account.","excerpt":"","category":"58c5cb2ed217601900fe9f6b","createdAt":"2015-12-18T12:49:02.185Z","project":"5673fa4a4b2a680d00524eb2","next":{"description":"","pages":[]},"childrenPages":[]}

get/api/v1/features/get


Gets a list of features enabled on the account. #Parameters None. #Returns A JSON object with the following properties: status - `ok` if the operation was successful, or `error` if there was a problem. features - an array containing a list of features enabled on the account.

User Information

Try It Out

get
{{ tryResults.results }}
Method{{ tryResults.method }}
Request Headers
{{ tryResults.requestHeaders }}
URL{{ tryResults.url }}
Request Data
{{ tryResults.data }}
Status
Response Headers
{{ tryResults.responseHeaders }}

Definition

{{ api_url }}{{ page_api_url }}

Result Format



Gets a list of features enabled on the account. #Parameters None. #Returns A JSON object with the following properties: status - `ok` if the operation was successful, or `error` if there was a problem. features - an array containing a list of features enabled on the account.
{"_id":"58c5cb2ed217601900fe9f72","project":"5673fa4a4b2a680d00524eb2","version":"58c5cb2ed217601900fe9f69","link_url":"","sync_unique":"","hidden":false,"slug":"apiv1plannerannouncementsget","link_external":false,"isReference":false,"type":"get","category":"58c5cb2ed217601900fe9f6b","next":{"pages":[],"description":""},"createdAt":"2015-12-18T12:52:50.259Z","githubsync":"","order":6,"body":"Gets the current announcement released to MyHomeworkSpace Users.\n\n#Parameters\ndate - the date to check for an announcement. Provided in the URL.\n#Returns\nA JSON object with the following properties:\n\nstatus - `ok` if the operation was successful, or `error` if there was a problem.\nannouncement - A JavaScript object if there is an announcement, or `null`.\n[block:callout]\n{\n  \"type\": \"info\",\n  \"title\": \"Announcement Formatting\",\n  \"body\": \"The announcement will be in HTML formatting, so there may be links using the `<a>` tag, or formatting using the `<em>`, `<strong>`, and `<span>` tags. Please make sure your application can be used appropriately with this feature.\",\n  \"sidebar\": true\n}\n[/block]","excerpt":"","user":"5673fa1b4b2a680d00524eb1","updates":[],"api":{"results":{"codes":[{"name":"OK, Announcement Found","code":"{\n\t\"status\": \"ok\",\n\t\"announcement\": {\n\t\t\"text\": \"Some important announcement\"\n\t}\n}","language":"json","status":200},{"language":"json","status":200,"name":"OK, No announcement","code":"{\n\t\"status\": \"ok\",\n\t\"announcement\": {\n\t}\n}"},{"code":"{\n\t\"status\": \"error\",\n}","language":"json","status":400}]},"settings":"","auth":"required","params":[{"in":"path","required":false,"desc":"The date you want to check for the announcement","default":"","type":"string","name":"date","_id":"5674680e4fdd650d00f39df2","ref":""}],"url":"/planner/announcements/get/:date","examples":{"codes":[]},"method":"get"},"title":"/api/v1/planner/announcements/get","__v":0,"childrenPages":[]}

get/api/v1/planner/announcements/get


Path Params

date:
string
The date you want to check for the announcement
Gets the current announcement released to MyHomeworkSpace Users. #Parameters date - the date to check for an announcement. Provided in the URL. #Returns A JSON object with the following properties: status - `ok` if the operation was successful, or `error` if there was a problem. announcement - A JavaScript object if there is an announcement, or `null`. [block:callout] { "type": "info", "title": "Announcement Formatting", "body": "The announcement will be in HTML formatting, so there may be links using the `<a>` tag, or formatting using the `<em>`, `<strong>`, and `<span>` tags. Please make sure your application can be used appropriately with this feature.", "sidebar": true } [/block]

User Information

Try It Out

get
{{ tryResults.results }}
Method{{ tryResults.method }}
Request Headers
{{ tryResults.requestHeaders }}
URL{{ tryResults.url }}
Request Data
{{ tryResults.data }}
Status
Response Headers
{{ tryResults.responseHeaders }}

Definition

{{ api_url }}{{ page_api_url }}

Result Format



Gets the current announcement released to MyHomeworkSpace Users. #Parameters date - the date to check for an announcement. Provided in the URL. #Returns A JSON object with the following properties: status - `ok` if the operation was successful, or `error` if there was a problem. announcement - A JavaScript object if there is an announcement, or `null`. [block:callout] { "type": "info", "title": "Announcement Formatting", "body": "The announcement will be in HTML formatting, so there may be links using the `<a>` tag, or formatting using the `<em>`, `<strong>`, and `<span>` tags. Please make sure your application can be used appropriately with this feature.", "sidebar": true } [/block]