Resource Templates

Resource templates are objects placed in Resource Collections. Each template has an assigned type (e.g. Document, Assignment, Discussion).

Table of Contents

Resource Template Objects

Field Name Description Type Required
id Id

The Schoology Id of the template

integer
title Title

The title the template. Note that documents do not require a title.

string true
uid User Id

The creator of 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 this template item is. Note that we only support assignment, discussion, page, and document creation currently.

{assessment, assignment, discussion, page, album, document, folder} true
template_fields Template Fields

Fields specific to this template type.

object

Operations - [realm]/[realm_id]/resources, collections/[collection_id]/resources

list

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

Path

GET https://api.schoology.com/v1/collections/[collection_id]/resources

GET https://api.schoology.com/v1/[realm]/[realm_id]/resources

Content

none

Return

An object containing the parent collection in the ‘parent’ attribute and a list of resource templates for the requested folder in the ‘resources’ attribute

Pass an optional f=[folder_id] GET parameter to specify your desired folder. Omission of this parameter will return the root level

Pass an optional with_attachments=1 GET parameter to retrieve attachments of this piece of content

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>

create

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

Path

POST https://api.schoology.com/v1/collections/[collection_id]/resources

POST https://api.schoology.com/v1/[realm]/[realm_id]/resources

Content

An object containing template fields

An example document template post might be:

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

Resource Type Specific Fields

Template Fields : Page

Field Name Description Type Required
body Body

The content of the resource Page

string

Template Fields : Discussion

Field Name Description Type Required
body Body

The description of the discussion

string

Template Fields : assignment

Field Name Description Type Required
body Body

The description of the assignment

string
max_points Max Points

The max number of points for this assignment

integer

Template Fields : assessment

Field Name Description Type Required
body Body

The description of the assignment

string
max_points Max Points

The max number of points for this assignment

integer

Template Fields : Document

Note to create a document you need to send in an attachment with it like you do for any other content type that supports attachments. See here.

Field Name Description Type Required
document_type Document Type

The type of content attached to this item {file,link,video,embed}

string