Planner override API
API for creating, accessing and updating planner override. PlannerOverrides are used to control the visibility of objects displayed on the Planner.
A PlannerOverride object looks like:
// User-controlled setting for whether an item should be displayed on the planner
// or not
{
// The ID of the planner override
"id": 234,
// The type of the associated object for the planner override
"plannable_type": "Assignment",
// The id of the associated object for the planner override
"plannable_id": 1578941,
// The id of the associated user for the planner override
"user_id": 1578941,
// The current published state of the item, synced with the associated object
"workflow_state": "published",
// Controls whether or not the associated plannable item is marked complete on the
// planner
"marked_complete": false,
// Controls whether or not the associated plannable item shows up in the
// opportunities list
"dismissed": false,
// The datetime of when the planner override was created
"created_at": "2017-05-09T10:12:00Z",
// The datetime of when the planner override was updated
"updated_at": "2017-05-09T10:12:00Z",
// The datetime of when the planner override was deleted, if applicable
"deleted_at": "2017-05-15T12:12:00Z"
}
List planner items PlannerOverridesController#items_index
GET /api/v1/planner/items
Retrieve the paginated list of objects to be shown on the planner for the current user with the associated planner override to override an item's visibility if set.
[
{
"context_type": "Course",
"course_id": 1,
"visible_in_planner": true, // Whether or not it is displayed on the student planner
"planner_override": { ... planner override object ... }, // Associated PlannerOverride object if user has toggled visibility for the object on the planner
"submissions": false, // The statuses of the user's submissions for this object
"plannable_id": "123",
"plannable_type": "discussion_topic",
"plannable": { ... discussion topic object },
"html_url": "/courses/1/discussion_topics/8"
},
{
"context_type": "Course",
"course_id": 1,
"visible_in_planner": true,
"planner_override": {
"id": 3,
"plannable_type": "Assignment",
"plannable_id": 1,
"user_id": 2,
"workflow_state": "active",
"marked_complete": true, // A user-defined setting for marking items complete in the planner
"dismissed": false, // A user-defined setting for hiding items from the opportunities list
"deleted_at": null,
"created_at": "2017-05-18T18:35:55Z",
"updated_at": "2017-05-18T18:35:55Z"
},
"submissions": { // The status as it pertains to the current user
"excused": false,
"graded": false,
"late": false,
"missing": true,
"needs_grading": false,
"with_feedback": false
},
"plannable_id": "456",
"plannable_type": "assignment",
"plannable": { ... assignment object ... },
"html_url": "http://canvas.instructure.com/courses/1/assignments/1#submit"
},
{
"visible_in_planner": true,
"planner_override": null,
"submissions": false, // false if no associated assignment exists for the plannable item
"plannable_id": "789",
"plannable_type": "planner_note",
"plannable": {
"id": 1,
"todo_date": "2017-05-30T06:00:00Z",
"title": "hello",
"details": "world",
"user_id": 2,
"course_id": null,
"workflow_state": "active",
"created_at": "2017-05-30T16:29:04Z",
"updated_at": "2017-05-30T16:29:15Z"
},
"html_url": "http://canvas.instructure.com/api/v1/planner_notes.1"
}
]
Request Parameters:
| Parameter | Type | Description | |
|---|---|---|---|
| start_date | Date |
Only return items starting from the given date. The value should be formatted as: yyyy-mm-dd or ISO 8601 YYYY-MM-DDTHH:MM:SSZ. |
|
| end_date | Date |
Only return items up to the given date. The value should be formatted as: yyyy-mm-dd or ISO 8601 YYYY-MM-DDTHH:MM:SSZ. |
|
| filter | string |
Only return items that have new or unread activity
Allowed values: |
Example Response:
List planner overrides PlannerOverridesController#index
GET /api/v1/planner/overrides
Retrieve a planner override for the current user
Returns a list of PlannerOverridesShow a planner override PlannerOverridesController#show
GET /api/v1/planner/overrides/:id
Retrieve a planner override for the current user
Returns a PlannerOverrideUpdate a planner override PlannerOverridesController#update
PUT /api/v1/planner/overrides/:id
Update a planner override's visibilty for the current user
Request Parameters:
| Parameter | Type | Description | |
|---|---|---|---|
| marked_complete | string |
determines whether the planner item is marked as completed |
|
| dismissed | string |
determines whether the planner item shows in the opportunities list |
Create a planner override PlannerOverridesController#create
POST /api/v1/planner/overrides
Create a planner override for the current user
Request Parameters:
| Parameter | Type | Description | |
|---|---|---|---|
| plannable_type | string |
Type of the item that you are overriding in the planner
Allowed values: |
|
| plannable_id | integer |
ID of the item that you are overriding in the planner |
|
| marked_complete | boolean |
If this is true, the item will show in the planner as completed |
|
| dismissed | boolean |
If this is true, the item will not show in the opportunities list |
Delete a planner override PlannerOverridesController#destroy
DELETE /api/v1/planner/overrides/:id
Delete a planner override for the current user
Returns a PlannerOverride