Discussion Reply

Replies are comments made to discussion threads

Table of Contents

Discussion replies are comments to any discussion thread.

Fields

Field Name Description Type Required
uid User Id

The Schoology user id of the user who created the comment

integer
comment Comment

The comment/reply text

string yes
created Created timestamp

The Unix timestamp when the comment was created

integer
parent_id Parent Id

If this comment is in reply to another comment, specify it here. To reply to the discussion thread instead of a specific comment, set the parent to “0”.

integer no
status Comment status

Whether or not the comment was deleted. Only available for course admins with ‘manage discussion’ permission.

{1,0}

Operations

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

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

create

Create a comment

Path

POST https://api.schoology.com/v1/[realm]/discussions/{post_id}/comments

Content

An object containing discussion reply fields

JSON
{
    "uid": "23867876",
    "comment": "This is an awesome topic"
}
XML
<body>
  <uid>23867876</uid>
  <comment>This is an awesome topic</comment>
</body>
Return

An object containing discussion reply fields

JSON
{
    "id": 3570315,
    "uid": 45552,
    "comment": "SOAP vs REST",
    "created": 1388169292,
    "parent_id": 0,
    "status": 1,
    "likes": 0,
    "user_like_action": false,
    "links": {
        "self": "http:\/\/...\/discussions\/5692161\/comments\/"
    }
}
XML
<?xml version="1.0" encoding="utf-8" ?>
<result>
    <id>3570315</id>
    <uid>45552</uid>
    <comment>SOAP vs REST</comment>
    <created>1388169292</created>
    <parent_id>0</parent_id>
    <status>1</status>
    <likes>0</likes>
    <user_like_action></user_like_action>
    <links>
        <self>http://.../discussions/5692161/comments/</self>
    </links>
</result>

list

View a list of comments (paged)

Path

GET https://api.schoology.com/v1/[realm]/discussions/{post_id}/comments

Content

none

Return

A collection of comment objects, each one containing discussion reply fields

JSON
{
    "comment": [
        {
            "id": 3570315,
            "uid": 45552,
            "comment": "SOAP vs REST",
            "created": 1388169292,
            "parent_id": 0,
            "status": 1,
            "likes": 0,
            "user_like_action": false,
            "links": {
                "self": "http:\/\/...\/comments\/3570315"
            }
        },
        {
            "id": 3570317,
            "uid": 45552,
            "comment": "RESTful vs SOAP",
            "created": 1388169354,
            "parent_id": 0,
            "status": 1,
            "likes": 0,
            "user_like_action": false,
            "links": {
                "self": "http:\/\/...\/comments\/3570317"
            }
        }
    ]
}
XML
<?xml version="1.0" encoding="utf-8" ?>
<result>
    <comment>
        <id>3570315</id>
        <uid>45552</uid>
        <comment>SOAP vs REST</comment>
        <created>1388169292</created>
        <parent_id>0</parent_id>
        <status>1</status>
        <likes>0</likes>
        <user_like_action></user_like_action>
        <links>
            <self>http://.../comments/3570315</self>
        </links>
    </comment>
    <comment>
        <id>3570317</id>
        <uid>45552</uid>
        <comment>RESTful vs SOAP</comment>
        <created>1388169354</created>
        <parent_id>0</parent_id>
        <status>1</status>
        <likes>0</likes>
        <user_like_action></user_like_action>
        <links>
            <self>http://.../comments/3570317</self>
        </links>
    </comment>
</result>

view

View a specified comment

Path

GET https://api.schoology.com/v1/[realm]/discussions/{post_id}/comments/{id}

Content

none

Return

An object containing discussion reply fields

JSON
{
    "id": 3570315,
    "uid": 45552,
    "comment": "SOAP vs REST",
    "created": 1388169292,
    "parent_id": 0,
    "status": 1,
    "likes": 0,
    "user_like_action": false
}
XML
<?xml version="1.0" encoding="utf-8" ?>
<result>
	<id>3570315</id>
	<uid>45552</uid>
	<comment>SOAP vs REST</comment>
	<created>1388169292</created>
	<parent_id>0</parent_id>
	<status>1</status>
	<likes>0</likes>
	<user_like_action></user_like_action>
</result>

delete

Delete a comment (cannot be undone)

Path

DELETE https://api.schoology.com/v1/[realm]/discussions/{post_id}/comments/{id}

Content

none

Return

none