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).

Fields

FieldNameDescriptionType
idIdThe Schoology Id of the template.integer
title*TitleThe title of the template. Note that documents do not require a title.string
uidUser IdThe creator (user) id for the template.integer
resource_notesResource NotesResource notes that can be attached to the actual template.string
folder_idFolder IdThe resource folder this item is in.integer
collection_idCollection IdThe Collection this item is contained in.integer
type*Template typeThe type of template. Supported values include assessment, assignment, discussion, page, album, document, folder.string
template_fieldsTemplate FieldsFields specific to this template type (see Template Fields below).object

* = Required

Template Fields

Page

FieldNameDescriptionType
bodyBodyThe content of the resource Page.string

Discussion

FieldNameDescriptionType
bodyBodyThe description of the discussion.string

Assignment

FieldNameDescriptionType
bodyBodyThe description of the assignment.string
max_pointsMax PointsThe maximum number of points for this assignment.integer

Assessment

FieldNameDescriptionType
bodyBodyThe description of the assessment.string
max_pointsMax PointsThe maximum number of points for this assessment.integer

Document

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

FieldNameDescriptionType
document_typeDocument TypeThe type of content attached to this item. One of: file, link, video, embed.string

GET collections/{collection id}/resources

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).
json
{
  "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"
  }
}
xml
<?xml version="1.0" encoding="utf-8" ?>
<result>
    <resources>
        <id>5825423</id>
        <title>YouTube</title>
        <type>document</type>
        <resource_notes />
        <collection_id>5825417</collection_id>
        <uid>48289</uid>
        <last_updated>1389717511</last_updated>
        <created>1389717511</created>
        <template_fields>
            <document_type>link</document_type>
        </template_fields>
        <folder_id>0</folder_id>
    </resources>
    <total>1</total>
    <links>
        <self>http:\/\/...?start=0&amp;limit=20</self>
    </links>
</result>

GET {realm}/{realm id}/resources

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).
json
{
  "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"
  }
}
xml
<?xml version="1.0" encoding="utf-8" ?>
<result>
    <resources>
        <id>5825423</id>
        <title>YouTube</title>
        <type>document</type>
        <resource_notes />
        <collection_id>5825417</collection_id>
        <uid>48289</uid>
        <last_updated>1389717511</last_updated>
        <created>1389717511</created>
        <template_fields>
            <document_type>link</document_type>
        </template_fields>
        <folder_id>0</folder_id>
    </resources>
    <total>1</total>
    <links>
        <self>http:\/\/...?start=0&amp;limit=20</self>
    </links>
</result>

POST collections/{collection id}/resources

Create a Template in the specified collection.

Content An object containing template fields.

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

Return An object containing template fields.

POST {realm}/{realm id}/resources

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

Content An object containing template fields.

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

Return An object containing template fields.