Skip to content

Resource Templates

Resource templates are objects placed in Resource Collections. Each template has an assigned type (e.g. Document, Assignment, Discussion). Operations are available at the collection and realm resource endpoints; realm resource collections are only available for groups and schools. Templates include common metadata (id, title, creator, folder/collection, type) and a template_fields object containing fields specific to the template type (page, discussion, assignment, assessment, document).

Field Name Description Type
id Id The Schoology Id of the template. integer
title* Title The title of the template. Note that documents do not require a title. string
uid User Id The creator (user) id for the template. integer
resource_notes Resource Notes Resource notes that can be attached to the actual template. string
folder_id Folder Id The resource folder this item is in. integer
collection_id Collection Id The Collection this item is contained in. integer
type* Template type The type of template. Supported values include assessment, assignment, discussion, page, album, document, folder. string
template_fields Template Fields Fields specific to this template type (see Template Fields below). object

* = Required

Field Name Description Type
body Body The content of the resource Page. string
Field Name Description Type
body Body The description of the discussion. string
Field Name Description Type
body Body The description of the assignment. string
max_points Max Points The maximum number of points for this assignment. integer
Field Name Description Type
body Body The description of the assessment. string
max_points Max Points The maximum number of points for this assessment. integer

Note: To create a document you must include an attachment (same as other content types that support attachments).

Field Name Description Type
document_type Document Type The type of content attached to this item. One of: file, link, video, embed. string

List a collection’s resources.

Parameters:

  • f — folder id (optional). Pass to specify a particular folder; omission returns root level.
  • with_attachments — set to 1 to retrieve attachments of the piece of content (optional).
{
"resources": [
{
"id": 5825423,
"title": "YouTube",
"type": "document",
"resource_notes": "",
"collection_id": 5825417,
"uid": 48289,
"last_updated": 1389717511,
"created": 1389717511,
"template_fields": {
"document_type": "link"
},
"folder_id": 0
}
],
"total": 1,
"links": {
"self": "http:\/\/...?start=0&limit=20"
}
}

List a realm’s resources. Realm resource collections are only available for groups and schools.

Parameters:

  • f — folder id (optional).
  • with_attachments — set to 1 to retrieve attachments (optional).
{
"resources": [
{
"id": 5825423,
"title": "YouTube",
"type": "document",
"resource_notes": "",
"collection_id": 5825417,
"uid": 48289,
"last_updated": 1389717511,
"created": 1389717511,
"template_fields": {
"document_type": "link"
},
"folder_id": 0
}
],
"total": 1,
"links": {
"self": "http:\/\/...?start=0&limit=20"
}
}

POST collections/{collection id}/resources

Section titled “POST collections/{collection id}/resources”

Create a Template in the specified collection.

Content An object containing template fields.

{
"title": "A handy search engine",
"type": "document",
"resource_notes": "a few notes",
"attachments": [
{
"url": "www.google.com"
}
]
}

Return An object containing template fields.

Create a Template in the specified realm collection. Realm resource collections are only available for groups and schools.

Content An object containing template fields.

{
"title": "A handy search engine",
"type": "document",
"resource_notes": "a few notes",
"attachments": [
{
"url": "www.google.com"
}
]
}

Return An object containing template fields.