Documents

Documents are standalone File/Links

Table of Contents

Documents are currently supported in Courses and Schools. On the website, group documents are done through Resources. Documents are simple pieces of content that simply have one attachment. Because a document must have an attachment, all available document have attachments just like an piece of content that accepts the with_attachment query parameter. If you pass in the with_attachment parameter you will get the same response as the request without the parameter.

Fields

Field Name Description Type Required
id ID

The Unique ID of the document

integer no
title Title

The Document Title

string
course_fid Course Folder ID

The course folder ID this content is in. Only applicable if realm = course

integer
available Available

Is this available under course completion rules

integer {0,1}
published Published

Is this piece of content published (1) or unpublished (0)

integer {0,1}
attachments Attachment

Attachment array

array
url URL

For creating documents with link or embed, send the value in this field

string
display_inline Display Inline

For creating documents with links, this field determines whether the link will open in an iframe (1) or a new tab (0)

integer {0,1}
file-attachments File

For creating documents with files, follow the standard file attachment technique

array
count_in_grade Count in Grade

Can be used for materials such as pre-assessments or practice work, allowing parents/students to see progress while knowing the score is not impacting a students calculated grade. This field can be used in a PUT operation. It only applies to Course Sections realm and External Tool material enabled for grading.

{0,1} default: 1
collected_only Collected Only

Allows teachers to simply mark materials as completed or not; useful for collecting forms or documenting in-class participation. This field can be used in a PUT operation. It only applies to Course Sections realm and External Tool material enabled for grading.

{0,1} default: 0
auto_publish_grades Automatically Publish Grades

Assignment grades will be visible to students and guardians as soon as they are entered.

{0,1} default: 1

Operations

The operations below are available for the following realms (replace [realm] with the appropriate realm and ID):

RealmPath
Schoolsschools/{id}
Course Sectionssections/{id}

create

Create a Document

Path

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

Content

An object containing document fields. ‘url’ or ‘file-attachments’ are required. If both are given, the ‘file-attachments’ will be respected and ‘url’ ignored

JSON
{
    "title": "Sample document",
    "file-attachment": {
        "id": [
            213123234
        ]
    }
}
XML
<body>
  <title>Sample document</title>
  <file-attachment>
    <id>
      <id>213123234</id>
    </id>
  </file-attachment>
</body>
Return

An object containing document fields

JSON
{
    "id": 5698289,
    "title": "logo-1239021.jpg",
    "course_fid": 0,
    "available": 1,
    "published": 1,
    "completion_status": "",
    "completed": 0,
    "attachments": {
        "files": {
            "file": [
                {
                    "id": 1458867,
                    "type": "file",
                    "title": "logo-1239021.jpg",
                    "filename": "logo-1239021.jpg",
                    "filesize": 3825,
                    "md5_checksum": "769392e30b6",
                    "timestamp": 1388421315,
                    "filemime": "image\/jpeg",
                    "download_path": "http:\/\/...3e4487.jpg",
                    "extension": "jpg",
                    "converted_status": 4,
                    "converted_type": 3,
                    "dimensions": "",
                    "thumbnail": "http:\/\/...3e4487.jpg",
                    "thumbnail_dimensions": "120x90"
                }
            ]
        }
    }
}
XML
<?xml version="1.0" encoding="utf-8" ?>
<result>
    <id>5698289</id>
    <title>logo-1239021.jpg</title>
    <course_fid>0</course_fid>
    <available>1</available>
    <published>1</published>
    <completion_status />
    <completed>0</completed>
    <attachments>
        <files>
            <file>
                <id>1458867</id>
                <type>file</type>
                <title>logo-1239021.jpg</title>
                <filename>logo-1239021.jpg</filename>
                <filesize>3825</filesize>
                <md5_checksum>769392e30b6</md5_checksum>
                <timestamp>1388421315</timestamp>
                <filemime>image/jpeg</filemime>
                <download_path>http://...3e4487.jpg</download_path>
                <extension>jpg</extension>
                <converted_status>4</converted_status>
                <converted_type>3</converted_type>
                <dimensions />
                <thumbnail>http://...3e4487.jpg</thumbnail>
                <thumbnail_dimensions>120x90</thumbnail_dimensions>
            </file>
        </files>
    </attachments>
</result>

list

View a list of documents (paged). The following query string can (optionally) be appended:

  • with_tags: retrieve tags of this piece of content.
Path

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

Content

none

Return

A collection of document objects, each one containing document fields

JSON
{
    "document": [
        {
            "id": 5698289,
            "title": "logo-1239021.jpg",
            "course_fid": 0,
            "available": 1,
            "published": 1,
            "completion_status": "",
            "completed": 0,
            "attachments": {
                "files": {
                    "file": [
                        {
                            "id": 1458867,
                            "type": "file",
                            "title": "logo-1239021.jpg",
                            "filename": "logo-1239021.jpg",
                            "filesize": 3825,
                            "md5_checksum": "67769392e30b6",
                            "timestamp": 1388421315,
                            "filemime": "image\/jpeg",
                            "download_path": "http:\/\/...1a0c3e4487.jpg",
                            "extension": "jpg",
                            "converted_status": 4,
                            "converted_type": 3,
                            "dimensions": "",
                            "thumbnail": "http:\/\/...1a0c3e4487.jpg",
                            "thumbnail_dimensions": "120x90"
                        }
                    ]
                }
            }
        }
    ],
    "total": "1",
    "links": {
        "self": "http:\/\/...\/documents?start=0&limit=20"
    }
}
XML
<?xml version="1.0" encoding="utf-8" ?>
<result>
    <document>
        <id>5698289</id>
        <title>logo-1239021.jpg</title>
        <course_fid>0</course_fid>
        <available>1</available>
        <published>1</published>
        <completion_status />
        <completed>0</completed>
        <attachments>
            <files>
                <file>
                    <id>1458867</id>
                    <type>file</type>
                    <title>logo-1239021.jpg</title>
                    <filename>logo-1239021.jpg</filename>
                    <filesize>3825</filesize>
                    <md5_checksum>67769392e30b6</md5_checksum>
                    <timestamp>1388421315</timestamp>
                    <filemime>image/jpeg</filemime>
                    <download_path>http://...1a0c3e4487.jpg</download_path>
                    <extension>jpg</extension>
                    <converted_status>4</converted_status>
                    <converted_type>3</converted_type>
                    <dimensions />
                    <thumbnail>http://...1a0c3e4487.jpg</thumbnail>
                    <thumbnail_dimensions>120x90</thumbnail_dimensions>
                </file>
            </files>
        </attachments>
    </document>
    <total>1</total>
    <links>
        <self>http://.../documents?start=0&amp;limit=20</self>
    </links>
</result>

view

View a specified document. The following query string can (optionally) be appended:

  • with_tags: retrieve tags of this piece of content.
Path

GET https://api.schoology.com/v1/[realm]/documents/{id}

Content

none

Return

An object containing document fields

JSON
{
    "id": 5698289,
    "title": "",
    "course_fid": 0,
    "available": 1,
    "published": 1,
    "completion_status": "",
    "completed": 0,
    "attachments": {
        "files": {
            "file": [
                {
                    "id": 1458867,
                    "type": "file",
                    "title": "logo-1239021.jpg",
                    "filename": "logo-1239021.jpg",
                    "filesize": 3825,
                    "md5_checksum": "d4a67769392e30b6",
                    "timestamp": 1388421315,
                    "filemime": "image\/jpeg",
                    "download_path": "http:\/\/...3e4487.jpg",
                    "extension": "jpg",
                    "converted_status": 4,
                    "converted_type": 3,
                    "dimensions": "",
                    "thumbnail": "http:\/\/...3e4487.jpg",
                    "thumbnail_dimensions": "120x90"
                }
            ]
        }
    }
}
XML
<?xml version="1.0" encoding="utf-8" ?>
<result>
    <id>5698289</id>
    <title />
    <course_fid>0</course_fid>
    <available>1</available>
    <published>1</published>
    <completion_status />
    <completed>0</completed>
    <attachments>
        <files>
            <file>
                <id>1458867</id>
                <type>file</type>
                <title>logo-1239021.jpg</title>
                <filename>logo-1239021.jpg</filename>
                <filesize>3825</filesize>
                <md5_checksum>d4a67769392e30b6</md5_checksum>
                <timestamp>1388421315</timestamp>
                <filemime>image/jpeg</filemime>
                <download_path>http://...3e4487.jpg</download_path>
                <extension>jpg</extension>
                <converted_status>4</converted_status>
                <converted_type>3</converted_type>
                <dimensions />
                <thumbnail>http://...3e4487.jpg</thumbnail>
                <thumbnail_dimensions>120x90</thumbnail_dimensions>
            </file>
        </files>
    </attachments>
</result>

update

Modify a document. Title and published/unpublished can be changed

Path

PUT https://api.schoology.com/v1/[realm]/documents/{id}

Content

An object containing document fields

JSON
{
    "title": "Sample unpublished document",
    "published": "0"
}
XML
<body>
  <title>Sample unpublished document</title>
  <published>0</published>
</body>
Return

none

delete

Delete a document (cannot be undone)

Path

DELETE https://api.schoology.com/v1/[realm]/documents/{id}

Content

none

Return

none