- Source:
Functions for interacting with pages within courses
Methods
(async) create(optsopt, configopt) → {Promise.<CanvasPage>}
- Source:
- Author:
-
Creates a new page in a course
Parameters:
Name |
Type |
Attributes |
Description |
opts |
object
|
<optional>
|
object containing all arguments
Properties
Name |
Type |
Attributes |
Default |
Description |
courseId |
number
|
<optional>
|
default course id
|
Canvas course Id to query |
title |
string
|
<optional>
|
Untitled Page
|
The title of the page |
body |
string
|
<optional>
|
null
|
html body of the page |
editingRoles |
string
|
<optional>
|
teachers
|
usertype(s) who can edit |
notifyOfUpdate |
boolean
|
<optional>
|
|
if true, sends notification |
published |
boolean
|
<optional>
|
|
if true, publishes page upon
creation |
frontPage |
boolean
|
<optional>
|
|
if true, sets page as front page |
|
config |
APIConfig
|
<optional>
|
custom configuration for this specific endpoint
call (overwrites defaults that were included when api was initialized) |
Returns:
-
Type
-
Promise.<CanvasPage>
(async) delete(opts, configopt) → {Promise.<CanvasPage>}
- Source:
- Author:
-
Deletes a page from a course
Parameters:
Name |
Type |
Attributes |
Description |
opts |
object
|
|
object containing all arguments
Properties
Name |
Type |
Attributes |
Default |
Description |
pageURL |
string
|
|
|
Page url to delete (just last part of path) |
courseId |
number
|
<optional>
|
default course id
|
Canvas course Id to query |
|
config |
APIConfig
|
<optional>
|
custom configuration for this specific endpoint
call (overwrites defaults that were included when api was initialized) |
Returns:
-
Type
-
Promise.<CanvasPage>
(async) get(opts, configopt) → {Promise.<CanvasPage>}
- Source:
- Author:
-
Get info on a specific page in a course
Parameters:
Name |
Type |
Attributes |
Description |
opts |
object
|
|
object containing all arguments
Properties
Name |
Type |
Attributes |
Default |
Description |
pageURL |
string
|
|
|
Canvas page url (just the last part of
path) |
courseId |
number
|
<optional>
|
default course id
|
Canvas course Id to query |
|
config |
APIConfig
|
<optional>
|
custom configuration for this specific endpoint
call (overwrites defaults that were included when api was initialized) |
Returns:
-
Type
-
Promise.<CanvasPage>
(async) list(optsopt, configopt) → {Promise.<Array.<CanvasPage>>}
- Source:
- Author:
-
Gets the list of pages in a course
Parameters:
Name |
Type |
Attributes |
Description |
opts |
object
|
<optional>
|
object containing all arguments
Properties
Name |
Type |
Attributes |
Description |
courseId |
number
|
<optional>
|
Canvas course Id to query |
|
config |
APIConfig
|
<optional>
|
custom configuration for this specific endpoint
call (overwrites defaults that were included when api was initialized) |
Returns:
-
Type
-
Promise.<Array.<CanvasPage>>
(async) update(opts, configopt) → {Promise.<CanvasPage>}
- Source:
- Author:
-
Updates a Canvas page
Parameters:
Name |
Type |
Attributes |
Description |
opts |
object
|
|
object containing all arguments
update
Properties
Name |
Type |
Attributes |
Default |
Description |
pageURL |
string
|
|
|
Canvas page url (just the last part of
path) |
courseId |
number
|
<optional>
|
=default course id
|
Canvas course ID holding the page to |
notifyOfUpdate |
boolean
|
<optional>
|
|
if true, send notification |
title |
string
|
<optional>
|
current value
|
New title of the page |
body |
string
|
<optional>
|
current value
|
New html body of the page |
editingRoles |
string
|
<optional>
|
current value
|
New usertype(s) who
can edit |
published |
boolean
|
<optional>
|
current value
|
New publish status of
page |
frontPage |
boolean
|
<optional>
|
current value
|
New front page status of
page |
|
config |
APIConfig
|
<optional>
|
custom configuration for this specific endpoint
call (overwrites defaults that were included when api was initialized) |
Returns:
-
Type
-
Promise.<CanvasPage>