Website : rimsha.abasa.com
backdoor
Home
Console
Upload
information
Create File
Create Folder
About
Tools
:
/
var
/
canvas
/
public
/
doc
/
api
/
Filename :
discussion_topics.html
back
Copy
<!DOCTYPE html> <html> <head> <meta name="Content-Type" content="text/html;charset=UTF-8"> <meta charset="UTF-8"> <title>Discussion Topics - Canvas LMS REST API Documentation</title> <link rel="stylesheet" href="css/common.css" type="text/css" media="screen" charset="utf-8" /> <link href="css/prettify.css" rel="stylesheet" type="text/css" media="screen" /> <script src="js/jquery.min.js" type="text/javascript"></script> <script src="js/prettify.js" type="text/javascript"></script> <script type="text/javascript"> $(function() { // set up pretty-printing in static docs generated from .md files $('pre.code.bash').addClass('prettyprint language-bash'); $('pre.code.html').addClass('prettyprint language-html'); $('pre.code.xml').addClass('prettyprint language-xml'); $('pre.code.json').addClass('prettyprint language-js'); $('pre.code.javascript').addClass('prettyprint language-js'); prettyPrint(); }); </script> </head> <body> <div id="header"> <h1> <a href="index.html">Canvas LMS - REST API and Extensions Documentation</a> </h1> </div> <div id="sidebar"> <nav> <div class="expand-all-toggle"> <input id="toggle-input" type="checkbox" onClick="toggle(this)"> <label for="toggle-input" class="toggle-label">Expand all</label> </div> <div class="ac-container"> <input name="header" class="ac-input" id="sidebar-basics" type="checkbox" > <label class="ac-label" for="sidebar-basics">Basics</label> <div class="ac-text"> <div class="ac-sub"> <a class="" href="file.graphql.html">GraphQL</a><a class="" href="file.changelog.html">API Change Log</a><a class="" href="file.object_ids.html">SIS IDs</a><a class="" href="file.pagination.html">Pagination</a><a class="" href="file.throttling.html">Throttling</a><a class="" href="file.compound_documents.html">Compound Documents</a><a class="" href="file.file_uploads.html">File Uploads</a><a class="" href="file.endpoint_attributes.html">API Endpoint Attributes</a><a class="" href="file.masquerading.html">Masquerading</a> </div> </div> </div> <div class="ac-container"> <input name="header" class="ac-input" id="sidebar-oauth2" type="checkbox" > <label class="ac-label" for="sidebar-oauth2">OAuth2</label> <div class="ac-text"> <div class="ac-sub"> <a class="" href="file.oauth.html">OAuth2 Overview</a><a class="" href="file.oauth_endpoints.html">OAuth2 Endpoints</a><a class="" href="file.developer_keys.html">Developer Keys</a> </div> </div> </div> <div class="ac-container"> <input name="header" class="ac-input" id="sidebar-resources" type="checkbox" checked > <label class="ac-label" for="sidebar-resources">Resources</label> <div class="ac-text"> <div class="ac-sub"> <a href="all_resources.html" class="">All Resources Reference</a> <a class="" href="access_tokens.html">Access Tokens</a> <a class="" href="account_calendars.html">Account Calendars</a> <a class="" href="account_notifications.html">Account Notifications</a> <a class="" href="account_reports.html">Account Reports</a> <a class="" href="accounts.html">Accounts</a> <a class="" href="accounts_(lti).html">Accounts (LTI)</a> <a class="" href="admins.html">Admins</a> <a class="" href="announcement_external_feeds.html">Announcement External Feeds</a> <a class="" href="announcements.html">Announcements</a> <a class="" href="api_token_scopes.html">API Token Scopes</a> <a class="" href="appointment_groups.html">Appointment Groups</a> <a class="" href="assignment_extensions.html">Assignment Extensions</a> <a class="" href="assignment_groups.html">Assignment Groups</a> <a class="" href="assignments.html">Assignments</a> <a class="" href="authentication_providers.html">Authentication Providers</a> <a class="" href="authentications_log.html">Authentications Log</a> <a class="" href="blackout_dates.html">Blackout Dates</a> <a class="" href="blueprint_courses.html">Blueprint Courses</a> <a class="" href="bookmarks.html">Bookmarks</a> <a class="" href="brand_configs.html">Brand Configs</a> <a class="" href="calendar_events.html">Calendar Events</a> <a class="" href="collaborations.html">Collaborations</a> <a class="" href="comm_messages.html">CommMessages</a> <a class="" href="communication_channels.html">Communication Channels</a> <a class="" href="conferences.html">Conferences</a> <a class="" href="content_exports.html">Content Exports</a> <a class="" href="content_migrations.html">Content Migrations</a> <a class="" href="content_security_policy_settings.html">Content Security Policy Settings</a> <a class="" href="content_shares.html">Content Shares</a> <a class="" href="conversations.html">Conversations</a> <a class="" href="course_audit_log.html">Course Audit log</a> <a class="" href="course_pace.html">Course Pace</a> <a class="" href="course_quiz_extensions.html">Course Quiz Extensions</a> <a class="" href="courses.html">Courses</a> <a class="" href="custom_gradebook_columns.html">Custom Gradebook Columns</a> <a class="current" href="discussion_topics.html">Discussion Topics</a> <a class="" href="enrollment_terms.html">Enrollment Terms</a> <a class="" href="enrollments.html">Enrollments</a> <a class="" href="e_portfolios.html">ePortfolios</a> <a class="" href="e_pub_exports.html">ePub Exports</a> <a class="" href="error_reports.html">Error Reports</a> <a class="" href="external_tools.html">External Tools</a> <a class="" href="favorites.html">Favorites</a> <a class="" href="feature_flags.html">Feature Flags</a> <a class="" href="files.html">Files</a> <a class="" href="grade_change_log.html">Grade Change Log</a> <a class="" href="gradebook_history.html">Gradebook History</a> <a class="" href="grading_period_sets.html">Grading Period Sets</a> <a class="" href="grading_periods.html">Grading Periods</a> <a class="" href="grading_standards.html">Grading Standards</a> <a class="" href="group_categories.html">Group Categories</a> <a class="" href="groups.html">Groups</a> <a class="" href="history.html">History</a> <a class="" href="inst_access_tokens.html">InstAccess tokens</a> <a class="" href="jw_ts.html">JWTs</a> <a class="" href="late_policy.html">Late Policy</a> <a class="" href="learning_object_dates.html">Learning Object Dates</a> <a class="" href="line_items.html">Line Items</a> <a class="" href="live_assessments.html">LiveAssessments</a> <a class="" href="logins.html">Logins</a> <a class="" href="lti_resource_links.html">LTI Resource Links</a> <a class="" href="media_objects.html">Media Objects</a> <a class="" href="moderated_grading.html">Moderated Grading</a> <a class="" href="modules.html">Modules</a> <a class="" href="names_and_role.html">Names and Role</a> <a class="" href="notification_preferences.html">Notification Preferences</a> <a class="" href="originality_reports.html">Originality Reports</a> <a class="" href="outcome_groups.html">Outcome Groups</a> <a class="" href="outcome_imports.html">Outcome Imports</a> <a class="" href="outcome_results.html">Outcome Results</a> <a class="" href="outcomes.html">Outcomes</a> <a class="" href="pages.html">Pages</a> <a class="" href="peer_reviews.html">Peer Reviews</a> <a class="" href="planner.html">Planner</a> <a class="" href="poll_sessions.html">Poll Sessions</a> <a class="" href="poll_choices.html">PollChoices</a> <a class="" href="polls.html">Polls</a> <a class="" href="poll_submissions.html">PollSubmissions</a> <a class="" href="proficiency_ratings.html">Proficiency Ratings</a> <a class="" href="progress.html">Progress</a> <a class="" href="public_jwk.html">Public JWK</a> <a class="" href="quiz_assignment_overrides.html">Quiz Assignment Overrides</a> <a class="" href="quiz_extensions.html">Quiz Extensions</a> <a class="" href="quiz_ip_filters.html">Quiz IP Filters</a> <a class="" href="quiz_question_groups.html">Quiz Question Groups</a> <a class="" href="quiz_questions.html">Quiz Questions</a> <a class="" href="quiz_reports.html">Quiz Reports</a> <a class="" href="quiz_statistics.html">Quiz Statistics</a> <a class="" href="quiz_submission_events.html">Quiz Submission Events</a> <a class="" href="quiz_submission_files.html">Quiz Submission Files</a> <a class="" href="quiz_submission_questions.html">Quiz Submission Questions</a> <a class="" href="quiz_submission_user_list.html">Quiz Submission User List</a> <a class="" href="quiz_submissions.html">Quiz Submissions</a> <a class="" href="quizzes.html">Quizzes</a> <a class="" href="result.html">Result</a> <a class="" href="roles.html">Roles</a> <a class="" href="rubrics.html">Rubrics</a> <a class="" href="score.html">Score</a> <a class="" href="search.html">Search</a> <a class="" href="sections.html">Sections</a> <a class="" href="services.html">Services</a> <a class="" href="shared_brand_configs.html">Shared Brand Configs</a> <a class="" href="sis_import_errors.html">SIS Import Errors</a> <a class="" href="sis_imports.html">SIS Imports</a> <a class="" href="sis_integration.html">SIS Integration</a> <a class="" href="smart_search.html">Smart Search</a> <a class="" href="submission_comments.html">Submission Comments</a> <a class="" href="submissions.html">Submissions</a> <a class="" href="tabs.html">Tabs</a> <a class="" href="temporary_enrollment_pairings.html">Temporary Enrollment Pairings</a> <a class="" href="user_observees.html">User Observees</a> <a class="" href="users.html">Users</a> <a class="" href="what_if_grades.html">What If Grades</a> </div> </div> </div> <div class="ac-container"> <input name="header" class="ac-input" id="sidebar-outcomes" type="checkbox" > <label class="ac-label" for="sidebar-outcomes">Outcomes</label> <div class="ac-text"> <div class="ac-sub"> <a href="file.outcomes_csv.html" class="">Outcomes CSV Format</a> </div> </div> </div> <div class="ac-container"> <input name="header" class="ac-input" id="sidebar-groupCategories" type="checkbox" > <label class="ac-label" for="sidebar-groupCategories">Group Categories</label> <div class="ac-text"> <div class="ac-sub"> <a href="file.group_category_csv.html" class="">Group Categories CSV Format</a> </div> </div> </div> <div class="ac-container"> <input name="header" class="ac-input" id="sidebar-sis" type="checkbox" > <label class="ac-label" for="sidebar-sis">SIS</label> <div class="ac-text"> <div class="ac-sub"> <a href="file.sis_csv.html" class="">SIS CSV Format</a> </div> </div> </div> <div class="ac-container"> <input name="header" class="ac-input" id="sidebar-externalTools" type="checkbox" > <label class="ac-label" for="sidebar-externalTools">External Tools</label> <div class="ac-text"> <div class="ac-sub"> <input name="header" class="ac-input" id="sidebar-externalTools-lti" type="checkbox" > <label class="ac-label level1-label" for="sidebar-externalTools-lti">LTI</label> <div class="ac-sub-text"> <a class="" href="file.tools_intro.html">Introduction</a><a class="" href="file.registration.html">Registration</a><a class="" href="file.lti_dev_key_config.html">Configuring</a><a class="" href="file.tools_variable_substitutions.html">Variable Substitutions</a><a class="" href="file.content_item.html">Deep Linking</a><a class="" href="file.assignment_tools.html">Grading</a><a class="" href="file.provisioning.html">Provisioning</a><a class="" href="file.lti_window_post_message.html">PostMessage</a> <div class="ac-sub"> <input name="header" class="ac-input" id="sidebar-externalTools-lti-placements" type="checkbox" > <label class="ac-label level2-label" for="sidebar-externalTools-lti-placements">Placements</label> <div class="ac-sub-text-nested"> <a class="" href="file.placements_overview.html">Placements Overview</a><a class="" href="file.navigation_tools.html">Navigation</a><a class="" href="file.homework_submission_placement.html">Homework Submission</a><a class="" href="file.editor_button_placement.html">Editor Button</a><a class="" href="file.migration_selection_placement.html">Migration Selection</a><a class="" href="file.link_selection_placement.html">Link Selection (Modules)</a><a class="" href="file.assignment_selection_placement.html">Assignment Selection</a><a class="" href="file.collaborations_placement.html">Collaborations</a> </div> </div> </div> </div> <a href="file.xapi.html" class="">xAPI</a> <a href="file.canvas_roles.html" class="">Canvas Roles</a> </div> <div class="ac-text"> <div class="ac-sub"> <input name="header" class="ac-input" id="sidebar-externalTools-plagiarism" type="checkbox" > <label class="ac-label level1-label" for="sidebar-externalTools-plagiarism">Plagiarism Detection Platform</label> <div class="ac-sub-text"> <a href="file.plagiarism_platform.html" class="">Overview</a> <a class="" href="plagiarism_detection_platform_assignments.html">Plagiarism Detection Platform Assignments</a> <a class="" href="plagiarism_detection_platform_users.html">Plagiarism Detection Platform Users</a> <a class="" href="plagiarism_detection_submissions.html">Plagiarism Detection Submissions</a> <a class="" href="webhooks_subscriptions_for_plagiarism_platform.html">Webhooks Subscriptions for Plagiarism Platform</a> <a href="file.jwt_access_tokens.html" class="">JWT Access Tokens</a> </div> </div> </div> </div> <div class="ac-container"> <input name="header" class="ac-input" id="sidebar-dataServices" type="checkbox" > <label class="ac-label" for="sidebar-dataServices">Data Services</label> <div class="ac-text"> <div class="ac-sub"> <input name="header" class="ac-input" id="sidebar-dataServices-liveEvents" type="checkbox" > <label class="ac-label level1-label" for="sidebar-dataServices-liveEvents">Live Events</label> <div class="ac-sub-text"> <div class="ac-sub"> <input name="header" class="ac-input" id="sidebar-dataServices-liveEvents-overview" type="checkbox" > <label class="ac-label level2-label" for="sidebar-dataServices-liveEvents-overview">Overview</label> <div class="ac-sub-text-nested"> <a class="" href="file.data_service_introduction.html">Introduction</a><a class="" href="file.data_service_setup.html">Setup</a><a class="" href="file.data_service_caliper_structure.html">Caliper</a><a class="" href="file.data_service_canvas_event_metadata.html">Metadata</a> </div> </div> <span class="sub-label">Event Format</span> </div> <div class="ac-sub-text"> <div class="ac-sub"> <input name="header" class="ac-input" id="sidebar-dataServices-liveEvents-eventFormat-canvas" type="checkbox" > <label class="ac-label level2-label" for="sidebar-dataServices-liveEvents-eventFormat-canvas">Canvas</label> <div class="ac-sub-text-nested"> <a class="" href="file.data_service_canvas_account.html">Account</a><a class="" href="file.data_service_canvas_asset.html">Asset</a><a class="" href="file.data_service_canvas_assignment.html">Assignment</a><a class="" href="file.data_service_canvas_attachment.html">Attachment</a><a class="" href="file.data_service_canvas_content.html">Content</a><a class="" href="file.data_service_canvas_conversation.html">Conversation</a><a class="" href="file.data_service_canvas_course.html">Course</a><a class="" href="file.data_service_canvas_discussion.html">Discussion</a><a class="" href="file.data_service_canvas_enrollment.html">Enrollment</a><a class="" href="file.data_service_canvas_grade.html">Grade</a><a class="" href="file.data_service_canvas_group.html">Group</a><a class="" href="file.data_service_canvas_learning.html">Learning</a><a class="" href="file.data_service_canvas_logged.html">Logged</a><a class="" href="file.data_service_canvas_module.html">Module</a><a class="" href="file.data_service_canvas_outcome.html">Outcome</a><a class="" href="file.data_service_canvas_plagiarism.html">Plagiarism</a><a class="" href="file.data_service_canvas_quiz.html">Quiz</a><a class="" href="file.data_service_canvas_rubric.html">Rubric</a><a class="" href="file.data_service_canvas_sis.html">Sis</a><a class="" href="file.data_service_canvas_submission.html">Submission</a><a class="" href="file.data_service_canvas_syllabus.html">Syllabus</a><a class="" href="file.data_service_canvas_user.html">User</a><a class="" href="file.data_service_canvas_wiki.html">Wiki</a> </div> </div> </div> <div class="ac-sub-text"> <div class="ac-sub"> <input name="header" class="ac-input" id="sidebar-dataServices-liveEvents-eventFormat-caliper" type="checkbox" > <label class="ac-label level2-label" for="sidebar-dataServices-liveEvents-eventFormat-caliper">Caliper IMS 1.1</label> <div class="ac-sub-text-nested"> <a class="" href="file.data_service_caliper_assessment.html">Assessment</a><a class="" href="file.data_service_caliper_basic.html">Basic</a><a class="" href="file.data_service_caliper_forum.html">Forum</a><a class="" href="file.data_service_caliper_grading.html">Grading</a><a class="" href="file.data_service_caliper_navigation_events.html">Navigation Events</a><a class="" href="file.data_service_caliper_session.html">Session</a> </div> </div> </div> </div> </div> </div> <div class="sidebar-trailing-background"></div> <script> function toggle(source) { let expandText = document.querySelector('label[for="toggle-input"]') let isChecked = document.querySelector('input[id="toggle-input"]').checked let checkboxes = document.querySelectorAll('input[name="header"]'); checkboxes.forEach(checkbox => { if (checkbox !== source) { checkbox.checked = source.checked } }); expandText.innerHTML = isChecked ? 'Collapse all' : 'Expand all' } </script> </nav> </div> <div id="content"><div class="service"> <h1>Discussion Topics API</h1> <table id='quicklinks'> </table> <p>API for accessing and participating in discussion topics in groups and courses.</p> <div class='object_definition'> <h3><a name="FileAttachment">A FileAttachment object looks like:</a></h3> <pre class="example code prettyprint"><code class="language-js">// A file attachment { "content-type": "unknown/unknown", "url": "http://www.example.com/courses/1/files/1/download", "filename": "content.txt", "display_name": "content.txt" }</code></pre> </div> <div class='object_definition'> <h3><a name="DiscussionTopic">A DiscussionTopic object looks like:</a></h3> <pre class="example code prettyprint"><code class="language-js">// A discussion topic { // The ID of this topic. "id": 1, // The topic title. "title": "Topic 1", // The HTML content of the message body. "message": "<p>content here</p>", // The URL to the discussion topic in canvas. "html_url": "https://<canvas>/courses/1/discussion_topics/2", // The datetime the topic was posted. If it is null it hasn't been posted yet. // (see delayed_post_at) "posted_at": "2037-07-21T13:29:31Z", // The datetime for when the last reply was in the topic. "last_reply_at": "2037-07-28T19:38:31Z", // If true then a user may not respond to other replies until that user has made // an initial reply. Defaults to false. "require_initial_post": false, // Whether or not posts in this topic are visible to the user. "user_can_see_posts": true, // The count of entries in the topic. "discussion_subentry_count": 0, // The read_state of the topic for the current user, 'read' or 'unread'. "read_state": "read", // The count of unread entries of this topic for the current user. "unread_count": 0, // Whether or not the current user is subscribed to this topic. "subscribed": true, // (Optional) Why the user cannot subscribe to this topic. Only one reason will // be returned even if multiple apply. Can be one of: 'initial_post_required': // The user must post a reply first; 'not_in_group_set': The user is not in the // group set for this graded group discussion; 'not_in_group': The user is not // in this topic's group; 'topic_is_announcement': This topic is an announcement "subscription_hold": "not_in_group_set", // The unique identifier of the assignment if the topic is for grading, // otherwise null. "assignment_id": null, // The datetime to publish the topic (if not right away). "delayed_post_at": null, // Whether this discussion topic is published (true) or draft state (false) "published": true, // The datetime to lock the topic (if ever). "lock_at": null, // Whether or not the discussion is 'closed for comments'. "locked": false, // Whether or not the discussion has been 'pinned' by an instructor "pinned": false, // Whether or not this is locked for the user. "locked_for_user": true, // (Optional) Information for the user about the lock. Present when // locked_for_user is true. "lock_info": null, // (Optional) An explanation of why this is locked for the user. Present when // locked_for_user is true. "lock_explanation": "This discussion is locked until September 1 at 12:00am", // The username of the topic creator. "user_name": "User Name", // DEPRECATED An array of topic_ids for the group discussions the user is a part // of. "topic_children": [5, 7, 10], // An array of group discussions the user is a part of. Fields include: id, // group_id "group_topic_children": [{"id":5,"group_id":1}, {"id":7,"group_id":5}, {"id":10,"group_id":4}], // If the topic is for grading and a group assignment this will point to the // original topic in the course. "root_topic_id": null, // If the topic is a podcast topic this is the feed url for the current user. "podcast_url": "/feeds/topics/1/enrollment_1XAcepje4u228rt4mi7Z1oFbRpn3RAkTzuXIGOPe.rss", // The type of discussion. Values are 'side_comment' or 'not_threaded', for // discussions that only allow one level of nested comments, and 'threaded' for // fully threaded discussions. "discussion_type": "side_comment", // The unique identifier of the group category if the topic is a group // discussion, otherwise null. "group_category_id": null, // Array of file attachments. "attachments": null, // The current user's permissions on this topic. "permissions": {"attach":true}, // Whether or not users can rate entries in this topic. "allow_rating": true, // Whether or not grade permissions are required to rate entries. "only_graders_can_rate": true, // Whether or not entries should be sorted by rating. "sort_by_rating": true }</code></pre> </div> <div id="Services" class="method_details_list"> <div class="method_details first"> <h2 class='api_method_name' name='method.discussion_topics.index' data-subtopic='Discussion Topics'> <a name='method.discussion_topics.index' href='#method.discussion_topics.index'> List discussion topics </a> <span class='defined-in'><a href="https://github.com/instructure/canvas-lms/blob/master/app/controllers/discussion_topics_controller.rb">DiscussionTopicsController#index</a></span> </h2> <h3 class='endpoint'> GET /api/v1/courses/:course_id/discussion_topics </h3> <div> <strong>Scope: </strong> <code class="scope">url:GET|/api/v1/courses/:course_id/discussion_topics</code> </div> <h3 class='endpoint'> GET /api/v1/groups/:group_id/discussion_topics </h3> <div> <strong>Scope: </strong> <code class="scope">url:GET|/api/v1/groups/:group_id/discussion_topics</code> </div> <p>Returns the paginated list of discussion topics for this course or group.</p> <h4>Request Parameters:</h4> <table class="request-params"> <thead> <tr> <th class="param-name">Parameter</th> <th class="param-req"></th> <th class="param-type">Type</th> <th class="param-desc">Description</th> </tr> </thead> <tbody> <tr class="request-param "> <td>include[]</td> <td> </td> <td>string</td> <td class="param-desc"> <p>If “all_dates” is passed, all dates associated with graded discussions’ assignments will be included. if “sections” is passed, includes the course sections that are associated with the topic, if the topic is specific to certain sections of the course. If “sections_user_count” is passed, then:</p> <pre class="code ruby"><code class="ruby">(a) If sections were asked for *and* the topic is specific to certain course sections, includes the number of users in each section. (as part of the section json asked for above) (b) Else, includes at the root level the total number of users in the topic's context (group or course) that the topic applies to. </code></pre> <p>If “overrides” is passed, the overrides for the assignment will be included</p> <p class="param-values"> <span class="allowed">Allowed values:</span> <code class=enum>all_dates</code>, <code class=enum>sections</code>, <code class=enum>sections_user_count</code>, <code class=enum>overrides</code> </p> </td> </tr> <tr class="request-param "> <td>order_by</td> <td> </td> <td>string</td> <td class="param-desc"> <p>Determines the order of the discussion topic list. Defaults to “position”.</p> <p class="param-values"> <span class="allowed">Allowed values:</span> <code class=enum>position</code>, <code class=enum>recent_activity</code>, <code class=enum>title</code> </p> </td> </tr> <tr class="request-param "> <td>scope</td> <td> </td> <td>string</td> <td class="param-desc"> <p>Only return discussion topics in the given state(s). Defaults to including all topics. Filtering is done after pagination, so pages may be smaller than requested if topics are filtered. Can pass multiple states as comma separated string.</p> <p class="param-values"> <span class="allowed">Allowed values:</span> <code class=enum>locked</code>, <code class=enum>unlocked</code>, <code class=enum>pinned</code>, <code class=enum>unpinned</code> </p> </td> </tr> <tr class="request-param "> <td>only_announcements</td> <td> </td> <td>boolean</td> <td class="param-desc"> <p>Return announcements instead of discussion topics. Defaults to false</p> </td> </tr> <tr class="request-param "> <td>filter_by</td> <td> </td> <td>string</td> <td class="param-desc"> <p>The state of the discussion topic to return. Currently only supports unread state.</p> <p class="param-values"> <span class="allowed">Allowed values:</span> <code class=enum>all</code>, <code class=enum>unread</code> </p> </td> </tr> <tr class="request-param "> <td>search_term</td> <td> </td> <td>string</td> <td class="param-desc"> <p>The partial title of the discussion topics to match and return.</p> </td> </tr> <tr class="request-param "> <td>exclude_context_module_locked_topics</td> <td> </td> <td>boolean</td> <td class="param-desc"> <p>For students, exclude topics that are locked by module progression. Defaults to false.</p> </td> </tr> </tbody> </table> <div class="examples"> <h4>Example Request:</h4> <h4><div class='inline'></div></h4> <pre class="example code prettyprint"><code class="language-bash">curl https://<canvas>/api/v1/courses/<course_id>/discussion_topics \ -H 'Authorization: Bearer <token>'</code></pre> </div> Returns a list of <a href='discussion_topics.html#DiscussionTopic'>DiscussionTopic</a> objects </div> <div class="method_details "> <h2 class='api_method_name' name='method.discussion_topics.create' data-subtopic='Discussion Topics'> <a name='method.discussion_topics.create' href='#method.discussion_topics.create'> Create a new discussion topic </a> <span class='defined-in'><a href="https://github.com/instructure/canvas-lms/blob/master/app/controllers/discussion_topics_controller.rb">DiscussionTopicsController#create</a></span> </h2> <h3 class='endpoint'> POST /api/v1/courses/:course_id/discussion_topics </h3> <div> <strong>Scope: </strong> <code class="scope">url:POST|/api/v1/courses/:course_id/discussion_topics</code> </div> <h3 class='endpoint'> POST /api/v1/groups/:group_id/discussion_topics </h3> <div> <strong>Scope: </strong> <code class="scope">url:POST|/api/v1/groups/:group_id/discussion_topics</code> </div> <p>Create an new discussion topic for the course or group.</p> <h4>Request Parameters:</h4> <table class="request-params"> <thead> <tr> <th class="param-name">Parameter</th> <th class="param-req"></th> <th class="param-type">Type</th> <th class="param-desc">Description</th> </tr> </thead> <tbody> <tr class="request-param "> <td>title</td> <td> </td> <td>string</td> <td class="param-desc"> <p>no description</p> </td> </tr> <tr class="request-param "> <td>message</td> <td> </td> <td>string</td> <td class="param-desc"> <p>no description</p> </td> </tr> <tr class="request-param "> <td>discussion_type</td> <td> </td> <td>string</td> <td class="param-desc"> <p>The type of discussion. Defaults to side_comment or not_threaded if not value is given. Accepted values are ‘side_comment’, ‘not_threaded’ for discussions that only allow one level of nested comments, and ‘threaded’ for fully threaded discussions.</p> <p class="param-values"> <span class="allowed">Allowed values:</span> <code class=enum>side_comment</code>, <code class=enum>threaded</code>, <code class=enum>not_threaded</code> </p> </td> </tr> <tr class="request-param "> <td>published</td> <td> </td> <td>boolean</td> <td class="param-desc"> <p>Whether this topic is published (true) or draft state (false). Only teachers and TAs have the ability to create draft state topics.</p> </td> </tr> <tr class="request-param "> <td>delayed_post_at</td> <td> </td> <td>DateTime</td> <td class="param-desc"> <p>If a timestamp is given, the topic will not be published until that time.</p> </td> </tr> <tr class="request-param "> <td>allow_rating</td> <td> </td> <td>boolean</td> <td class="param-desc"> <p>Whether or not users can rate entries in this topic.</p> </td> </tr> <tr class="request-param "> <td>lock_at</td> <td> </td> <td>DateTime</td> <td class="param-desc"> <p>If a timestamp is given, the topic will be scheduled to lock at the provided timestamp. If the timestamp is in the past, the topic will be locked.</p> </td> </tr> <tr class="request-param "> <td>podcast_enabled</td> <td> </td> <td>boolean</td> <td class="param-desc"> <p>If true, the topic will have an associated podcast feed.</p> </td> </tr> <tr class="request-param "> <td>podcast_has_student_posts</td> <td> </td> <td>boolean</td> <td class="param-desc"> <p>If true, the podcast will include posts from students as well. Implies podcast_enabled.</p> </td> </tr> <tr class="request-param "> <td>require_initial_post</td> <td> </td> <td>boolean</td> <td class="param-desc"> <p>If true then a user may not respond to other replies until that user has made an initial reply. Defaults to false.</p> </td> </tr> <tr class="request-param "> <td>assignment</td> <td> </td> <td>Assignment</td> <td class="param-desc"> <p>To create an assignment discussion, pass the assignment parameters as a sub-object. See the <a href="assignments.html#method.assignments_api.create" title="Create an Assignment API">Create an Assignment API</a> for the available parameters. The name parameter will be ignored, as it’s taken from the discussion title. If you want to make a discussion that was an assignment NOT an assignment, pass set_assignment = false as part of the assignment object</p> </td> </tr> <tr class="request-param "> <td>is_announcement</td> <td> </td> <td>boolean</td> <td class="param-desc"> <p>If true, this topic is an announcement. It will appear in the announcement’s section rather than the discussions section. This requires announcment-posting permissions.</p> </td> </tr> <tr class="request-param "> <td>pinned</td> <td> </td> <td>boolean</td> <td class="param-desc"> <p>If true, this topic will be listed in the “Pinned Discussion” section</p> </td> </tr> <tr class="request-param "> <td>position_after</td> <td> </td> <td>string</td> <td class="param-desc"> <p>By default, discussions are sorted chronologically by creation date, you can pass the id of another topic to have this one show up after the other when they are listed.</p> </td> </tr> <tr class="request-param "> <td>group_category_id</td> <td> </td> <td>integer</td> <td class="param-desc"> <p>If present, the topic will become a group discussion assigned to the group.</p> </td> </tr> <tr class="request-param "> <td>only_graders_can_rate</td> <td> </td> <td>boolean</td> <td class="param-desc"> <p>If true, only graders will be allowed to rate entries.</p> </td> </tr> <tr class="request-param "> <td>sort_by_rating</td> <td> </td> <td>boolean</td> <td class="param-desc"> <p>If true, entries will be sorted by rating.</p> </td> </tr> <tr class="request-param "> <td>attachment</td> <td> </td> <td>File</td> <td class="param-desc"> <p>A multipart/form-data form-field-style attachment. Attachments larger than 1 kilobyte are subject to quota restrictions.</p> </td> </tr> <tr class="request-param "> <td>specific_sections</td> <td> </td> <td>string</td> <td class="param-desc"> <p>A comma-separated list of sections ids to which the discussion topic should be made specific to. If it is not desired to make the discussion topic specific to sections, then this parameter may be omitted or set to “all”. Can only be present only on announcements and only those that are for a course (as opposed to a group).</p> </td> </tr> </tbody> </table> <div class="examples"> <h4>Example Request:</h4> <h4><div class='inline'></div></h4> <pre class="example code prettyprint"><code class="language-bash">curl https://<canvas>/api/v1/courses/<course_id>/discussion_topics \ -F title='my topic' \ -F message='initial message' \ -F podcast_enabled=1 \ -H 'Authorization: Bearer <token>' -F 'attachment=@<filename>' \</code></pre> <h4><div class='inline'></div></h4> <pre class="example code prettyprint"><code class="language-bash">curl https://<canvas>/api/v1/courses/<course_id>/discussion_topics \ -F title='my assignment topic' \ -F message='initial message' \ -F assignment[points_possible]=15 \ -H 'Authorization: Bearer <token>'</code></pre> </div> </div> <div class="method_details "> <h2 class='api_method_name' name='method.discussion_topics.update' data-subtopic='Discussion Topics'> <a name='method.discussion_topics.update' href='#method.discussion_topics.update'> Update a topic </a> <span class='defined-in'><a href="https://github.com/instructure/canvas-lms/blob/master/app/controllers/discussion_topics_controller.rb">DiscussionTopicsController#update</a></span> </h2> <h3 class='endpoint'> PUT /api/v1/courses/:course_id/discussion_topics/:topic_id </h3> <div> <strong>Scope: </strong> <code class="scope">url:PUT|/api/v1/courses/:course_id/discussion_topics/:topic_id</code> </div> <h3 class='endpoint'> PUT /api/v1/groups/:group_id/discussion_topics/:topic_id </h3> <div> <strong>Scope: </strong> <code class="scope">url:PUT|/api/v1/groups/:group_id/discussion_topics/:topic_id</code> </div> <p>Update an existing discussion topic for the course or group.</p> <h4>Request Parameters:</h4> <table class="request-params"> <thead> <tr> <th class="param-name">Parameter</th> <th class="param-req"></th> <th class="param-type">Type</th> <th class="param-desc">Description</th> </tr> </thead> <tbody> <tr class="request-param "> <td>title</td> <td> </td> <td>string</td> <td class="param-desc"> <p>no description</p> </td> </tr> <tr class="request-param "> <td>message</td> <td> </td> <td>string</td> <td class="param-desc"> <p>no description</p> </td> </tr> <tr class="request-param "> <td>discussion_type</td> <td> </td> <td>string</td> <td class="param-desc"> <p>The type of discussion. Defaults to side_comment or not_threaded if not value is given. Accepted values are ‘side_comment’, ‘not_threaded’ for discussions that only allow one level of nested comments, and ‘threaded’ for fully threaded discussions.</p> <p class="param-values"> <span class="allowed">Allowed values:</span> <code class=enum>side_comment</code>, <code class=enum>threaded</code>, <code class=enum>not_threaded</code> </p> </td> </tr> <tr class="request-param "> <td>published</td> <td> </td> <td>boolean</td> <td class="param-desc"> <p>Whether this topic is published (true) or draft state (false). Only teachers and TAs have the ability to create draft state topics.</p> </td> </tr> <tr class="request-param "> <td>delayed_post_at</td> <td> </td> <td>DateTime</td> <td class="param-desc"> <p>If a timestamp is given, the topic will not be published until that time.</p> </td> </tr> <tr class="request-param "> <td>lock_at</td> <td> </td> <td>DateTime</td> <td class="param-desc"> <p>If a timestamp is given, the topic will be scheduled to lock at the provided timestamp. If the timestamp is in the past, the topic will be locked.</p> </td> </tr> <tr class="request-param "> <td>podcast_enabled</td> <td> </td> <td>boolean</td> <td class="param-desc"> <p>If true, the topic will have an associated podcast feed.</p> </td> </tr> <tr class="request-param "> <td>podcast_has_student_posts</td> <td> </td> <td>boolean</td> <td class="param-desc"> <p>If true, the podcast will include posts from students as well. Implies podcast_enabled.</p> </td> </tr> <tr class="request-param "> <td>require_initial_post</td> <td> </td> <td>boolean</td> <td class="param-desc"> <p>If true then a user may not respond to other replies until that user has made an initial reply. Defaults to false.</p> </td> </tr> <tr class="request-param "> <td>assignment</td> <td> </td> <td>Assignment</td> <td class="param-desc"> <p>To create an assignment discussion, pass the assignment parameters as a sub-object. See the <a href="assignments.html#method.assignments_api.create" title="Create an Assignment API">Create an Assignment API</a> for the available parameters. The name parameter will be ignored, as it’s taken from the discussion title. If you want to make a discussion that was an assignment NOT an assignment, pass set_assignment = false as part of the assignment object</p> </td> </tr> <tr class="request-param "> <td>is_announcement</td> <td> </td> <td>boolean</td> <td class="param-desc"> <p>If true, this topic is an announcement. It will appear in the announcement’s section rather than the discussions section. This requires announcment-posting permissions.</p> </td> </tr> <tr class="request-param "> <td>pinned</td> <td> </td> <td>boolean</td> <td class="param-desc"> <p>If true, this topic will be listed in the “Pinned Discussion” section</p> </td> </tr> <tr class="request-param "> <td>position_after</td> <td> </td> <td>string</td> <td class="param-desc"> <p>By default, discussions are sorted chronologically by creation date, you can pass the id of another topic to have this one show up after the other when they are listed.</p> </td> </tr> <tr class="request-param "> <td>group_category_id</td> <td> </td> <td>integer</td> <td class="param-desc"> <p>If present, the topic will become a group discussion assigned to the group.</p> </td> </tr> <tr class="request-param "> <td>allow_rating</td> <td> </td> <td>boolean</td> <td class="param-desc"> <p>If true, users will be allowed to rate entries.</p> </td> </tr> <tr class="request-param "> <td>only_graders_can_rate</td> <td> </td> <td>boolean</td> <td class="param-desc"> <p>If true, only graders will be allowed to rate entries.</p> </td> </tr> <tr class="request-param "> <td>sort_by_rating</td> <td> </td> <td>boolean</td> <td class="param-desc"> <p>If true, entries will be sorted by rating.</p> </td> </tr> <tr class="request-param "> <td>specific_sections</td> <td> </td> <td>string</td> <td class="param-desc"> <p>A comma-separated list of sections ids to which the discussion topic should be made specific too. If it is not desired to make the discussion topic specific to sections, then this parameter may be omitted or set to “all”. Can only be present only on announcements and only those that are for a course (as opposed to a group).</p> </td> </tr> </tbody> </table> <div class="examples"> <h4>Example Request:</h4> <h4><div class='inline'></div></h4> <pre class="example code prettyprint"><code class="language-bash">curl https://<canvas>/api/v1/courses/<course_id>/discussion_topics/<topic_id> \ -F title='This will be positioned after Topic #1234' \ -F position_after=1234 \ -H 'Authorization: Bearer <token>'</code></pre> </div> </div> <div class="method_details "> <h2 class='api_method_name' name='method.discussion_topics.destroy' data-subtopic='Discussion Topics'> <a name='method.discussion_topics.destroy' href='#method.discussion_topics.destroy'> Delete a topic </a> <span class='defined-in'><a href="https://github.com/instructure/canvas-lms/blob/master/app/controllers/discussion_topics_controller.rb">DiscussionTopicsController#destroy</a></span> </h2> <h3 class='endpoint'> DELETE /api/v1/courses/:course_id/discussion_topics/:topic_id </h3> <div> <strong>Scope: </strong> <code class="scope">url:DELETE|/api/v1/courses/:course_id/discussion_topics/:topic_id</code> </div> <h3 class='endpoint'> DELETE /api/v1/groups/:group_id/discussion_topics/:topic_id </h3> <div> <strong>Scope: </strong> <code class="scope">url:DELETE|/api/v1/groups/:group_id/discussion_topics/:topic_id</code> </div> <p>Deletes the discussion topic. This will also delete the assignment, if it’s an assignment discussion.</p> <div class="examples"> <h4>Example Request:</h4> <h4><div class='inline'></div></h4> <pre class="example code prettyprint"><code class="language-bash">curl -X DELETE https://<canvas>/api/v1/courses/<course_id>/discussion_topics/<topic_id> \ -H 'Authorization: Bearer <token>'</code></pre> </div> </div> <div class="method_details "> <h2 class='api_method_name' name='method.discussion_topics.reorder' data-subtopic='Discussion Topics'> <a name='method.discussion_topics.reorder' href='#method.discussion_topics.reorder'> Reorder pinned topics </a> <span class='defined-in'><a href="https://github.com/instructure/canvas-lms/blob/master/app/controllers/discussion_topics_controller.rb">DiscussionTopicsController#reorder</a></span> </h2> <h3 class='endpoint'> POST /api/v1/courses/:course_id/discussion_topics/reorder </h3> <div> <strong>Scope: </strong> <code class="scope">url:POST|/api/v1/courses/:course_id/discussion_topics/reorder</code> </div> <h3 class='endpoint'> POST /api/v1/groups/:group_id/discussion_topics/reorder </h3> <div> <strong>Scope: </strong> <code class="scope">url:POST|/api/v1/groups/:group_id/discussion_topics/reorder</code> </div> <p>Puts the pinned discussion topics in the specified order. All pinned topics should be included.</p> <h4>Request Parameters:</h4> <table class="request-params"> <thead> <tr> <th class="param-name">Parameter</th> <th class="param-req"></th> <th class="param-type">Type</th> <th class="param-desc">Description</th> </tr> </thead> <tbody> <tr class="request-param "> <td>order[]</td> <td> Required </td> <td>integer</td> <td class="param-desc"> <p>The ids of the pinned discussion topics in the desired order. (For example, “order=104,102,103”.)</p> </td> </tr> </tbody> </table> </div> <div class="method_details "> <h2 class='api_method_name' name='method.discussion_entries.update' data-subtopic='Discussion Topics'> <a name='method.discussion_entries.update' href='#method.discussion_entries.update'> Update an entry </a> <span class='defined-in'><a href="https://github.com/instructure/canvas-lms/blob/master/app/controllers/discussion_entries_controller.rb">DiscussionEntriesController#update</a></span> </h2> <h3 class='endpoint'> PUT /api/v1/courses/:course_id/discussion_topics/:topic_id/entries/:id </h3> <div> <strong>Scope: </strong> <code class="scope">url:PUT|/api/v1/courses/:course_id/discussion_topics/:topic_id/entries/:id</code> </div> <h3 class='endpoint'> PUT /api/v1/groups/:group_id/discussion_topics/:topic_id/entries/:id </h3> <div> <strong>Scope: </strong> <code class="scope">url:PUT|/api/v1/groups/:group_id/discussion_topics/:topic_id/entries/:id</code> </div> <p>Update an existing discussion entry.</p> <p>The entry must have been created by the current user, or the current user must have admin rights to the discussion. If the edit is not allowed, a 401 will be returned.</p> <h4>Request Parameters:</h4> <table class="request-params"> <thead> <tr> <th class="param-name">Parameter</th> <th class="param-req"></th> <th class="param-type">Type</th> <th class="param-desc">Description</th> </tr> </thead> <tbody> <tr class="request-param "> <td>message</td> <td> </td> <td>string</td> <td class="param-desc"> <p>The updated body of the entry.</p> </td> </tr> </tbody> </table> <div class="examples"> <h4>Example Request:</h4> <h4><div class='inline'></div></h4> <pre class="example code prettyprint"><code class="language-bash">curl -X PUT 'https://<canvas>/api/v1/courses/<course_id>/discussion_topics/<topic_id>/entries/<entry_id>' \ -F 'message=<message>' \ -H "Authorization: Bearer <token>"</code></pre> </div> </div> <div class="method_details "> <h2 class='api_method_name' name='method.discussion_entries.destroy' data-subtopic='Discussion Topics'> <a name='method.discussion_entries.destroy' href='#method.discussion_entries.destroy'> Delete an entry </a> <span class='defined-in'><a href="https://github.com/instructure/canvas-lms/blob/master/app/controllers/discussion_entries_controller.rb">DiscussionEntriesController#destroy</a></span> </h2> <h3 class='endpoint'> DELETE /api/v1/courses/:course_id/discussion_topics/:topic_id/entries/:id </h3> <div> <strong>Scope: </strong> <code class="scope">url:DELETE|/api/v1/courses/:course_id/discussion_topics/:topic_id/entries/:id</code> </div> <h3 class='endpoint'> DELETE /api/v1/groups/:group_id/discussion_topics/:topic_id/entries/:id </h3> <div> <strong>Scope: </strong> <code class="scope">url:DELETE|/api/v1/groups/:group_id/discussion_topics/:topic_id/entries/:id</code> </div> <p>Delete a discussion entry.</p> <p>The entry must have been created by the current user, or the current user must have admin rights to the discussion. If the delete is not allowed, a 401 will be returned.</p> <p>The discussion will be marked deleted, and the user_id and message will be cleared out.</p> <div class="examples"> <h4>Example Request:</h4> <h4><div class='inline'></div></h4> <pre class="example code prettyprint"><code class="language-bash">curl -X DELETE 'https://<canvas>/api/v1/courses/<course_id>/discussion_topics/<topic_id>/entries/<entry_id>' \ -H "Authorization: Bearer <token>"</code></pre> </div> </div> <div class="method_details "> <h2 class='api_method_name' name='method.discussion_topics_api.show' data-subtopic='Discussion Topics'> <a name='method.discussion_topics_api.show' href='#method.discussion_topics_api.show'> Get a single topic </a> <span class='defined-in'><a href="https://github.com/instructure/canvas-lms/blob/master/app/controllers/discussion_topics_api_controller.rb">DiscussionTopicsApiController#show</a></span> </h2> <h3 class='endpoint'> GET /api/v1/courses/:course_id/discussion_topics/:topic_id </h3> <div> <strong>Scope: </strong> <code class="scope">url:GET|/api/v1/courses/:course_id/discussion_topics/:topic_id</code> </div> <h3 class='endpoint'> GET /api/v1/groups/:group_id/discussion_topics/:topic_id </h3> <div> <strong>Scope: </strong> <code class="scope">url:GET|/api/v1/groups/:group_id/discussion_topics/:topic_id</code> </div> <p>Returns data on an individual discussion topic. See the List action for the response formatting.</p> <h4>Request Parameters:</h4> <table class="request-params"> <thead> <tr> <th class="param-name">Parameter</th> <th class="param-req"></th> <th class="param-type">Type</th> <th class="param-desc">Description</th> </tr> </thead> <tbody> <tr class="request-param "> <td>include[]</td> <td> </td> <td>string</td> <td class="param-desc"> <p>If “all_dates” is passed, all dates associated with graded discussions’ assignments will be included. if “sections” is passed, includes the course sections that are associated with the topic, if the topic is specific to certain sections of the course. If “sections_user_count” is passed, then:</p> <pre class="code ruby"><code class="ruby">(a) If sections were asked for *and* the topic is specific to certain course sections, includes the number of users in each section. (as part of the section json asked for above) (b) Else, includes at the root level the total number of users in the topic's context (group or course) that the topic applies to. </code></pre> <p>If “overrides” is passed, the overrides for the assignment will be included</p> <p class="param-values"> <span class="allowed">Allowed values:</span> <code class=enum>all_dates</code>, <code class=enum>sections</code>, <code class=enum>sections_user_count</code>, <code class=enum>overrides</code> </p> </td> </tr> </tbody> </table> <div class="examples"> <h4>Example Request:</h4> <h4><div class='inline'></div></h4> <pre class="example code prettyprint"><code class="language-bash">curl https://<canvas>/api/v1/courses/<course_id>/discussion_topics/<topic_id> \ -H 'Authorization: Bearer <token>'</code></pre> </div> </div> <div class="method_details "> <h2 class='api_method_name' name='method.discussion_topics_api.summary' data-subtopic='Discussion Topics'> <a name='method.discussion_topics_api.summary' href='#method.discussion_topics_api.summary'> Summary </a> <span class='defined-in'><a href="https://github.com/instructure/canvas-lms/blob/master/app/controllers/discussion_topics_api_controller.rb">DiscussionTopicsApiController#summary</a></span> </h2> <h3 class='endpoint'> GET /api/v1/courses/:course_id/discussion_topics/:topic_id/summaries </h3> <div> <strong>Scope: </strong> <code class="scope">url:GET|/api/v1/courses/:course_id/discussion_topics/:topic_id/summaries</code> </div> <h3 class='endpoint'> GET /api/v1/groups/:group_id/discussion_topics/:topic_id/summaries </h3> <div> <strong>Scope: </strong> <code class="scope">url:GET|/api/v1/groups/:group_id/discussion_topics/:topic_id/summaries</code> </div> <p>Generates a summary for a discussion topic.</p> <h4>Request Parameters:</h4> <table class="request-params"> <thead> <tr> <th class="param-name">Parameter</th> <th class="param-req"></th> <th class="param-type">Type</th> <th class="param-desc">Description</th> </tr> </thead> <tbody> <tr class="request-param "> <td>userInput</td> <td> </td> <td>string</td> <td class="param-desc"> <p>Areas or topics for the summary to focus on.</p> </td> </tr> </tbody> </table> <div class="examples"> <h4>Example Request:</h4> <h4><div class='inline'></div></h4> <pre class="example code prettyprint"><code class="language-bash">curl https://<canvas>/api/v1/courses/<course_id>/discussion_topics/<topic_id>/summaries \ -H 'Authorization: Bearer <token>'</code></pre> </div> <div class="examples example_response"> <h4>Example Response:</h4> <h4><div class='inline'></div></h4> <pre class="example code prettyprint"><code class="language-js">{ "id": 1, "text": "This is a summary of the discussion topic." }</code></pre> </div> </div> <div class="method_details "> <h2 class='api_method_name' name='method.discussion_topics_api.disable_summary' data-subtopic='Discussion Topics'> <a name='method.discussion_topics_api.disable_summary' href='#method.discussion_topics_api.disable_summary'> Disable summary </a> <span class='defined-in'><a href="https://github.com/instructure/canvas-lms/blob/master/app/controllers/discussion_topics_api_controller.rb">DiscussionTopicsApiController#disable_summary</a></span> </h2> <h3 class='endpoint'> PUT /api/v1/courses/:course_id/discussion_topics/:topic_id/summaries/disable </h3> <div> <strong>Scope: </strong> <code class="scope">url:PUT|/api/v1/courses/:course_id/discussion_topics/:topic_id/summaries/disable</code> </div> <h3 class='endpoint'> PUT /api/v1/groups/:group_id/discussion_topics/:topic_id/summaries/disable </h3> <div> <strong>Scope: </strong> <code class="scope">url:PUT|/api/v1/groups/:group_id/discussion_topics/:topic_id/summaries/disable</code> </div> <p>Disables the summary for a discussion topic.</p> <div class="examples"> <h4>Example Request:</h4> <h4><div class='inline'></div></h4> <pre class="example code prettyprint"><code class="language-bash">curl -X PUT https://<canvas>/api/v1/courses/<course_id>/discussion_topics/<topic_id>/disable_summary \</code></pre> </div> <div class="examples example_response"> <h4>Example Response:</h4> <h4><div class='inline'></div></h4> <pre class="example code prettyprint"><code class="language-js">{ "success": true }</code></pre> </div> </div> <div class="method_details "> <h2 class='api_method_name' name='method.discussion_topics_api.summary_feedback' data-subtopic='Discussion Topics'> <a name='method.discussion_topics_api.summary_feedback' href='#method.discussion_topics_api.summary_feedback'> Summary Feedback </a> <span class='defined-in'><a href="https://github.com/instructure/canvas-lms/blob/master/app/controllers/discussion_topics_api_controller.rb">DiscussionTopicsApiController#summary_feedback</a></span> </h2> <h3 class='endpoint'> POST /api/v1/courses/:course_id/discussion_topics/:topic_id/summaries/:summary_id/feedback </h3> <div> <strong>Scope: </strong> <code class="scope">url:POST|/api/v1/courses/:course_id/discussion_topics/:topic_id/summaries/:summary_id/feedback</code> </div> <h3 class='endpoint'> POST /api/v1/groups/:group_id/discussion_topics/:topic_id/summaries/:summary_id/feedback </h3> <div> <strong>Scope: </strong> <code class="scope">url:POST|/api/v1/groups/:group_id/discussion_topics/:topic_id/summaries/:summary_id/feedback</code> </div> <p>Persists feedback on a discussion topic summary.</p> <h4>Request Parameters:</h4> <table class="request-params"> <thead> <tr> <th class="param-name">Parameter</th> <th class="param-req"></th> <th class="param-type">Type</th> <th class="param-desc">Description</th> </tr> </thead> <tbody> <tr class="request-param "> <td>_action</td> <td> </td> <td>string</td> <td class="param-desc"> <p>Required The action to take on the summary. Possible values are:</p> <ul><li> <p>“seen”: Marks the summary as seen. This action saves the feedback if it’s not already persisted.</p> </li><li> <p>“like”: Marks the summary as liked.</p> </li><li> <p>“dislike”: Marks the summary as disliked.</p> </li><li> <p>“reset_like”: Resets the like status of the summary.</p> </li><li> <p>“regenerate”: Regenerates the summary feedback.</p> </li><li> <p>“disable_summary”: Disables the summary feedback.</p> </li></ul> <p>Any other value will result in an error response.</p> </td> </tr> </tbody> </table> <div class="examples"> <h4>Example Request:</h4> <h4><div class='inline'></div></h4> <pre class="example code prettyprint"><code class="language-bash">curl -X POST https://<canvas>/api/v1/courses/<course_id>/discussion_topics/<topic_id>/summaries/<summary_id>/feedback \ -F '_action=like' \ -H "Authorization: Bearer</code></pre> </div> <div class="examples example_response"> <h4>Example Response:</h4> <h4><div class='inline'></div></h4> <pre class="example code prettyprint"><code class="language-js">{ "liked": true, "disliked": false }</code></pre> </div> </div> <div class="method_details "> <h2 class='api_method_name' name='method.discussion_topics_api.view' data-subtopic='Discussion Topics'> <a name='method.discussion_topics_api.view' href='#method.discussion_topics_api.view'> Get the full topic </a> <span class='defined-in'><a href="https://github.com/instructure/canvas-lms/blob/master/app/controllers/discussion_topics_api_controller.rb">DiscussionTopicsApiController#view</a></span> </h2> <h3 class='endpoint'> GET /api/v1/courses/:course_id/discussion_topics/:topic_id/view </h3> <div> <strong>Scope: </strong> <code class="scope">url:GET|/api/v1/courses/:course_id/discussion_topics/:topic_id/view</code> </div> <h3 class='endpoint'> GET /api/v1/groups/:group_id/discussion_topics/:topic_id/view </h3> <div> <strong>Scope: </strong> <code class="scope">url:GET|/api/v1/groups/:group_id/discussion_topics/:topic_id/view</code> </div> <p>Return a cached structure of the discussion topic, containing all entries, their authors, and their message bodies.</p> <p>May require (depending on the topic) that the user has posted in the topic. If it is required, and the user has not posted, will respond with a 403 Forbidden status and the body ‘require_initial_post’.</p> <p>In some rare situations, this cached structure may not be available yet. In that case, the server will respond with a 503 error, and the caller should try again soon.</p> <p>The response is an object containing the following keys:</p> <ul><li> <p>“participants”: A list of summary information on users who have posted to the discussion. Each value is an object containing their id, display_name, and avatar_url.</p> </li><li> <p>“unread_entries”: A list of entry ids that are unread by the current user. this implies that any entry not in this list is read.</p> </li><li> <p>“entry_ratings”: A map of entry ids to ratings by the current user. Entries not in this list have no rating. Only populated if rating is enabled.</p> </li><li> <p>“forced_entries”: A list of entry ids that have forced_read_state set to true. This flag is meant to indicate the entry’s read_state has been manually set to ‘unread’ by the user, so the entry should not be automatically marked as read.</p> </li><li> <p>“view”: A threaded view of all the entries in the discussion, containing the id, user_id, and message.</p> </li><li> <p>“new_entries”: Because this view is eventually consistent, it’s possible that newly created or updated entries won’t yet be reflected in the view. If the application wants to also get a flat list of all entries not yet reflected in the view, pass include_new_entries=1 to the request and this array of entries will be returned. These entries are returned in a flat array, in ascending created_at order.</p> </li></ul> <div class="examples"> <h4>Example Request:</h4> <h4><div class='inline'></div></h4> <pre class="example code prettyprint"><code class="language-bash">curl 'https://<canvas>/api/v1/courses/<course_id>/discussion_topics/<topic_id>/view' \ -H "Authorization: Bearer <token>"</code></pre> </div> <div class="examples example_response"> <h4>Example Response:</h4> <h4><div class='inline'></div></h4> <pre class="example code prettyprint"><code class="language-js">{ "unread_entries": [1,3,4], "entry_ratings": {3: 1}, "forced_entries": [1], "participants": [ { "id": 10, "display_name": "user 1", "avatar_image_url": "https://...", "html_url": "https://..." }, { "id": 11, "display_name": "user 2", "avatar_image_url": "https://...", "html_url": "https://..." } ], "view": [ { "id": 1, "user_id": 10, "parent_id": null, "message": "...html text...", "replies": [ { "id": 3, "user_id": 11, "parent_id": 1, "message": "...html....", "replies": [...] } ]}, { "id": 2, "user_id": 11, "parent_id": null, "message": "...html..." }, { "id": 4, "user_id": 10, "parent_id": null, "message": "...html..." } ] }</code></pre> </div> </div> <div class="method_details "> <h2 class='api_method_name' name='method.discussion_topics_api.add_entry' data-subtopic='Discussion Topics'> <a name='method.discussion_topics_api.add_entry' href='#method.discussion_topics_api.add_entry'> Post an entry </a> <span class='defined-in'><a href="https://github.com/instructure/canvas-lms/blob/master/app/controllers/discussion_topics_api_controller.rb">DiscussionTopicsApiController#add_entry</a></span> </h2> <h3 class='endpoint'> POST /api/v1/courses/:course_id/discussion_topics/:topic_id/entries </h3> <div> <strong>Scope: </strong> <code class="scope">url:POST|/api/v1/courses/:course_id/discussion_topics/:topic_id/entries</code> </div> <h3 class='endpoint'> POST /api/v1/groups/:group_id/discussion_topics/:topic_id/entries </h3> <div> <strong>Scope: </strong> <code class="scope">url:POST|/api/v1/groups/:group_id/discussion_topics/:topic_id/entries</code> </div> <p>Create a new entry in a discussion topic. Returns a json representation of the created entry (see documentation for ‘entries’ method) on success.</p> <h4>Request Parameters:</h4> <table class="request-params"> <thead> <tr> <th class="param-name">Parameter</th> <th class="param-req"></th> <th class="param-type">Type</th> <th class="param-desc">Description</th> </tr> </thead> <tbody> <tr class="request-param "> <td>message</td> <td> </td> <td>string</td> <td class="param-desc"> <p>The body of the entry.</p> </td> </tr> <tr class="request-param "> <td>attachment</td> <td> </td> <td>string</td> <td class="param-desc"> <p>a multipart/form-data form-field-style attachment. Attachments larger than 1 kilobyte are subject to quota restrictions.</p> </td> </tr> </tbody> </table> <div class="examples"> <h4>Example Request:</h4> <h4><div class='inline'></div></h4> <pre class="example code prettyprint"><code class="language-bash">curl 'https://<canvas>/api/v1/courses/<course_id>/discussion_topics/<topic_id>/entries.json' \ -F 'message=<message>' \ -F 'attachment=@<filename>' \ -H "Authorization: Bearer <token>"</code></pre> </div> </div> <div class="method_details "> <h2 class='api_method_name' name='method.discussion_topics_api.duplicate' data-subtopic='Discussion Topics'> <a name='method.discussion_topics_api.duplicate' href='#method.discussion_topics_api.duplicate'> Duplicate discussion topic </a> <span class='defined-in'><a href="https://github.com/instructure/canvas-lms/blob/master/app/controllers/discussion_topics_api_controller.rb">DiscussionTopicsApiController#duplicate</a></span> </h2> <h3 class='endpoint'> POST /api/v1/courses/:course_id/discussion_topics/:topic_id/duplicate </h3> <div> <strong>Scope: </strong> <code class="scope">url:POST|/api/v1/courses/:course_id/discussion_topics/:topic_id/duplicate</code> </div> <h3 class='endpoint'> POST /api/v1/groups/:group_id/discussion_topics/:topic_id/duplicate </h3> <div> <strong>Scope: </strong> <code class="scope">url:POST|/api/v1/groups/:group_id/discussion_topics/:topic_id/duplicate</code> </div> <p>Duplicate a discussion topic according to context (Course/Group)</p> <div class="examples"> <h4>Example Request:</h4> <h4><div class='inline'></div></h4> <pre class="example code prettyprint"><code class="language-bash">curl -X POST -H 'Authorization: Bearer <token>' \ https://<canvas>/api/v1/courses/123/discussion_topics/123/duplicate curl -X POST -H 'Authorization: Bearer <token>' \ https://<canvas>/api/v1/group/456/discussion_topics/456/duplicate</code></pre> </div> Returns a <a href='discussion_topics.html#DiscussionTopic'>DiscussionTopic</a> object </div> <div class="method_details "> <h2 class='api_method_name' name='method.discussion_topics_api.entries' data-subtopic='Discussion Topics'> <a name='method.discussion_topics_api.entries' href='#method.discussion_topics_api.entries'> List topic entries </a> <span class='defined-in'><a href="https://github.com/instructure/canvas-lms/blob/master/app/controllers/discussion_topics_api_controller.rb">DiscussionTopicsApiController#entries</a></span> </h2> <h3 class='endpoint'> GET /api/v1/courses/:course_id/discussion_topics/:topic_id/entries </h3> <div> <strong>Scope: </strong> <code class="scope">url:GET|/api/v1/courses/:course_id/discussion_topics/:topic_id/entries</code> </div> <h3 class='endpoint'> GET /api/v1/groups/:group_id/discussion_topics/:topic_id/entries </h3> <div> <strong>Scope: </strong> <code class="scope">url:GET|/api/v1/groups/:group_id/discussion_topics/:topic_id/entries</code> </div> <p>Retrieve the (paginated) top-level entries in a discussion topic.</p> <p>May require (depending on the topic) that the user has posted in the topic. If it is required, and the user has not posted, will respond with a 403 Forbidden status and the body ‘require_initial_post’.</p> <p>Will include the 10 most recent replies, if any, for each entry returned.</p> <p>If the topic is a root topic with children corresponding to groups of a group assignment, entries from those subtopics for which the user belongs to the corresponding group will be returned.</p> <p>Ordering of returned entries is newest-first by posting timestamp (reply activity is ignored).</p> <h4>API response field:</h4> <ul class="response_field"> <li> <span class='type'></span> <span class='name'>id</span> <div class='inline'> <p>The unique identifier for the entry.</p> </div> </li> <li> <span class='type'></span> <span class='name'>user_id</span> <div class='inline'> <p>The unique identifier for the author of the entry.</p> </div> </li> <li> <span class='type'></span> <span class='name'>editor_id</span> <div class='inline'> <p>The unique user id of the person to last edit the entry, if different than user_id.</p> </div> </li> <li> <span class='type'></span> <span class='name'>user_name</span> <div class='inline'> <p>The name of the author of the entry.</p> </div> </li> <li> <span class='type'></span> <span class='name'>message</span> <div class='inline'> <p>The content of the entry.</p> </div> </li> <li> <span class='type'></span> <span class='name'>read_state</span> <div class='inline'> <p>The read state of the entry, “read” or “unread”.</p> </div> </li> <li> <span class='type'></span> <span class='name'>forced_read_state</span> <div class='inline'> <p>Whether the read_state was forced (was set manually)</p> </div> </li> <li> <span class='type'></span> <span class='name'>created_at</span> <div class='inline'> <p>The creation time of the entry, in ISO8601 format.</p> </div> </li> <li> <span class='type'></span> <span class='name'>updated_at</span> <div class='inline'> <p>The updated time of the entry, in ISO8601 format.</p> </div> </li> <li> <span class='type'></span> <span class='name'>attachment</span> <div class='inline'> <p>JSON representation of the attachment for the entry, if any. Present only if there is an attachment.</p> </div> </li> <li> <span class='type'></span> <span class='name'>attachments</span> <div class='inline'> <p><strong>Deprecated</strong>. Same as attachment, but returned as a one-element array. Present only if there is an attachment.</p> </div> </li> <li> <span class='type'></span> <span class='name'>recent_replies</span> <div class='inline'> <p>The 10 most recent replies for the entry, newest first. Present only if there is at least one reply.</p> </div> </li> <li> <span class='type'></span> <span class='name'>has_more_replies</span> <div class='inline'> <p>True if there are more than 10 replies for the entry (i.e., not all were included in this response). Present only if there is at least one reply.</p> </div> </li> </ul> <div class="examples example_response"> <h4>Example Response:</h4> <h4><div class='inline'></div></h4> <pre class="example code prettyprint"><code class="language-js">[ { "id": 1019, "user_id": 7086, "user_name": "nobody@example.com", "message": "Newer entry", "read_state": "read", "forced_read_state": false, "created_at": "2011-11-03T21:33:29Z", "attachment": { "content-type": "unknown/unknown", "url": "http://www.example.com/files/681/download?verifier=JDG10Ruitv8o6LjGXWlxgOb5Sl3ElzVYm9cBKUT3", "filename": "content.txt", "display_name": "content.txt" } }, { "id": 1016, "user_id": 7086, "user_name": "nobody@example.com", "message": "first top-level entry", "read_state": "unread", "forced_read_state": false, "created_at": "2011-11-03T21:32:29Z", "recent_replies": [ { "id": 1017, "user_id": 7086, "user_name": "nobody@example.com", "message": "Reply message", "created_at": "2011-11-03T21:32:29Z" } ], "has_more_replies": false } ]</code></pre> </div> </div> <div class="method_details "> <h2 class='api_method_name' name='method.discussion_topics_api.add_reply' data-subtopic='Discussion Topics'> <a name='method.discussion_topics_api.add_reply' href='#method.discussion_topics_api.add_reply'> Post a reply </a> <span class='defined-in'><a href="https://github.com/instructure/canvas-lms/blob/master/app/controllers/discussion_topics_api_controller.rb">DiscussionTopicsApiController#add_reply</a></span> </h2> <h3 class='endpoint'> POST /api/v1/courses/:course_id/discussion_topics/:topic_id/entries/:entry_id/replies </h3> <div> <strong>Scope: </strong> <code class="scope">url:POST|/api/v1/courses/:course_id/discussion_topics/:topic_id/entries/:entry_id/replies</code> </div> <h3 class='endpoint'> POST /api/v1/groups/:group_id/discussion_topics/:topic_id/entries/:entry_id/replies </h3> <div> <strong>Scope: </strong> <code class="scope">url:POST|/api/v1/groups/:group_id/discussion_topics/:topic_id/entries/:entry_id/replies</code> </div> <p>Add a reply to an entry in a discussion topic. Returns a json representation of the created reply (see documentation for ‘replies’ method) on success.</p> <p>May require (depending on the topic) that the user has posted in the topic. If it is required, and the user has not posted, will respond with a 403 Forbidden status and the body ‘require_initial_post’.</p> <h4>Request Parameters:</h4> <table class="request-params"> <thead> <tr> <th class="param-name">Parameter</th> <th class="param-req"></th> <th class="param-type">Type</th> <th class="param-desc">Description</th> </tr> </thead> <tbody> <tr class="request-param "> <td>message</td> <td> </td> <td>string</td> <td class="param-desc"> <p>The body of the entry.</p> </td> </tr> <tr class="request-param "> <td>attachment</td> <td> </td> <td>string</td> <td class="param-desc"> <p>a multipart/form-data form-field-style attachment. Attachments larger than 1 kilobyte are subject to quota restrictions.</p> </td> </tr> </tbody> </table> <div class="examples"> <h4>Example Request:</h4> <h4><div class='inline'></div></h4> <pre class="example code prettyprint"><code class="language-bash">curl 'https://<canvas>/api/v1/courses/<course_id>/discussion_topics/<topic_id>/entries/<entry_id>/replies.json' \ -F 'message=<message>' \ -F 'attachment=@<filename>' \ -H "Authorization: Bearer <token>"</code></pre> </div> </div> <div class="method_details "> <h2 class='api_method_name' name='method.discussion_topics_api.replies' data-subtopic='Discussion Topics'> <a name='method.discussion_topics_api.replies' href='#method.discussion_topics_api.replies'> List entry replies </a> <span class='defined-in'><a href="https://github.com/instructure/canvas-lms/blob/master/app/controllers/discussion_topics_api_controller.rb">DiscussionTopicsApiController#replies</a></span> </h2> <h3 class='endpoint'> GET /api/v1/courses/:course_id/discussion_topics/:topic_id/entries/:entry_id/replies </h3> <div> <strong>Scope: </strong> <code class="scope">url:GET|/api/v1/courses/:course_id/discussion_topics/:topic_id/entries/:entry_id/replies</code> </div> <h3 class='endpoint'> GET /api/v1/groups/:group_id/discussion_topics/:topic_id/entries/:entry_id/replies </h3> <div> <strong>Scope: </strong> <code class="scope">url:GET|/api/v1/groups/:group_id/discussion_topics/:topic_id/entries/:entry_id/replies</code> </div> <p>Retrieve the (paginated) replies to a top-level entry in a discussion topic.</p> <p>May require (depending on the topic) that the user has posted in the topic. If it is required, and the user has not posted, will respond with a 403 Forbidden status and the body ‘require_initial_post’.</p> <p>Ordering of returned entries is newest-first by creation timestamp.</p> <h4>API response field:</h4> <ul class="response_field"> <li> <span class='type'></span> <span class='name'>id</span> <div class='inline'> <p>The unique identifier for the reply.</p> </div> </li> <li> <span class='type'></span> <span class='name'>user_id</span> <div class='inline'> <p>The unique identifier for the author of the reply.</p> </div> </li> <li> <span class='type'></span> <span class='name'>editor_id</span> <div class='inline'> <p>The unique user id of the person to last edit the entry, if different than user_id.</p> </div> </li> <li> <span class='type'></span> <span class='name'>user_name</span> <div class='inline'> <p>The name of the author of the reply.</p> </div> </li> <li> <span class='type'></span> <span class='name'>message</span> <div class='inline'> <p>The content of the reply.</p> </div> </li> <li> <span class='type'></span> <span class='name'>read_state</span> <div class='inline'> <p>The read state of the entry, “read” or “unread”.</p> </div> </li> <li> <span class='type'></span> <span class='name'>forced_read_state</span> <div class='inline'> <p>Whether the read_state was forced (was set manually)</p> </div> </li> <li> <span class='type'></span> <span class='name'>created_at</span> <div class='inline'> <p>The creation time of the reply, in ISO8601 format.</p> </div> </li> </ul> <div class="examples example_response"> <h4>Example Response:</h4> <h4><div class='inline'></div></h4> <pre class="example code prettyprint"><code class="language-js">[ { "id": 1015, "user_id": 7084, "user_name": "nobody@example.com", "message": "Newer message", "read_state": "read", "forced_read_state": false, "created_at": "2011-11-03T21:27:44Z" }, { "id": 1014, "user_id": 7084, "user_name": "nobody@example.com", "message": "Older message", "read_state": "unread", "forced_read_state": false, "created_at": "2011-11-03T21:26:44Z" } ]</code></pre> </div> </div> <div class="method_details "> <h2 class='api_method_name' name='method.discussion_topics_api.entry_list' data-subtopic='Discussion Topics'> <a name='method.discussion_topics_api.entry_list' href='#method.discussion_topics_api.entry_list'> List entries </a> <span class='defined-in'><a href="https://github.com/instructure/canvas-lms/blob/master/app/controllers/discussion_topics_api_controller.rb">DiscussionTopicsApiController#entry_list</a></span> </h2> <h3 class='endpoint'> GET /api/v1/courses/:course_id/discussion_topics/:topic_id/entry_list </h3> <div> <strong>Scope: </strong> <code class="scope">url:GET|/api/v1/courses/:course_id/discussion_topics/:topic_id/entry_list</code> </div> <h3 class='endpoint'> GET /api/v1/groups/:group_id/discussion_topics/:topic_id/entry_list </h3> <div> <strong>Scope: </strong> <code class="scope">url:GET|/api/v1/groups/:group_id/discussion_topics/:topic_id/entry_list</code> </div> <p>Retrieve a paginated list of discussion entries, given a list of ids.</p> <p>May require (depending on the topic) that the user has posted in the topic. If it is required, and the user has not posted, will respond with a 403 Forbidden status and the body ‘require_initial_post’.</p> <h4>Request Parameters:</h4> <table class="request-params"> <thead> <tr> <th class="param-name">Parameter</th> <th class="param-req"></th> <th class="param-type">Type</th> <th class="param-desc">Description</th> </tr> </thead> <tbody> <tr class="request-param "> <td>ids[]</td> <td> </td> <td>string</td> <td class="param-desc"> <p>A list of entry ids to retrieve. Entries will be returned in id order, smallest id first.</p> </td> </tr> </tbody> </table> <h4>API response field:</h4> <ul class="response_field"> <li> <span class='type'></span> <span class='name'>id</span> <div class='inline'> <p>The unique identifier for the reply.</p> </div> </li> <li> <span class='type'></span> <span class='name'>user_id</span> <div class='inline'> <p>The unique identifier for the author of the reply.</p> </div> </li> <li> <span class='type'></span> <span class='name'>user_name</span> <div class='inline'> <p>The name of the author of the reply.</p> </div> </li> <li> <span class='type'></span> <span class='name'>message</span> <div class='inline'> <p>The content of the reply.</p> </div> </li> <li> <span class='type'></span> <span class='name'>read_state</span> <div class='inline'> <p>The read state of the entry, “read” or “unread”.</p> </div> </li> <li> <span class='type'></span> <span class='name'>forced_read_state</span> <div class='inline'> <p>Whether the read_state was forced (was set manually)</p> </div> </li> <li> <span class='type'></span> <span class='name'>created_at</span> <div class='inline'> <p>The creation time of the reply, in ISO8601 format.</p> </div> </li> <li> <span class='type'></span> <span class='name'>deleted</span> <div class='inline'> <p>If the entry has been deleted, returns true. The user_id, user_name, and message will not be returned for deleted entries.</p> </div> </li> </ul> <div class="examples"> <h4>Example Request:</h4> <h4><div class='inline'></div></h4> <pre class="example code prettyprint"><code class="language-bash">curl 'https://<canvas>/api/v1/courses/<course_id>/discussion_topics/<topic_id>/entry_list?ids[]=1&ids[]=2&ids[]=3' \ -H "Authorization: Bearer <token>"</code></pre> </div> <div class="examples example_response"> <h4>Example Response:</h4> <h4><div class='inline'></div></h4> <pre class="example code prettyprint"><code class="language-js">[ { ... entry 1 ... }, { ... entry 2 ... }, { ... entry 3 ... }, ]</code></pre> </div> </div> <div class="method_details "> <h2 class='api_method_name' name='method.discussion_topics_api.mark_topic_read' data-subtopic='Discussion Topics'> <a name='method.discussion_topics_api.mark_topic_read' href='#method.discussion_topics_api.mark_topic_read'> Mark topic as read </a> <span class='defined-in'><a href="https://github.com/instructure/canvas-lms/blob/master/app/controllers/discussion_topics_api_controller.rb">DiscussionTopicsApiController#mark_topic_read</a></span> </h2> <h3 class='endpoint'> PUT /api/v1/courses/:course_id/discussion_topics/:topic_id/read </h3> <div> <strong>Scope: </strong> <code class="scope">url:PUT|/api/v1/courses/:course_id/discussion_topics/:topic_id/read</code> </div> <h3 class='endpoint'> PUT /api/v1/groups/:group_id/discussion_topics/:topic_id/read </h3> <div> <strong>Scope: </strong> <code class="scope">url:PUT|/api/v1/groups/:group_id/discussion_topics/:topic_id/read</code> </div> <p>Mark the initial text of the discussion topic as read.</p> <p>No request fields are necessary.</p> <p>On success, the response will be 204 No Content with an empty body.</p> <div class="examples"> <h4>Example Request:</h4> <h4><div class='inline'></div></h4> <pre class="example code prettyprint"><code class="language-bash">curl 'https://<canvas>/api/v1/courses/<course_id>/discussion_topics/<topic_id>/read.json' \ -X PUT \ -H "Authorization: Bearer <token>" \ -H "Content-Length: 0"</code></pre> </div> </div> <div class="method_details "> <h2 class='api_method_name' name='method.discussion_topics_api.mark_all_topic_read' data-subtopic='Discussion Topics'> <a name='method.discussion_topics_api.mark_all_topic_read' href='#method.discussion_topics_api.mark_all_topic_read'> Mark all topic as read </a> <span class='defined-in'><a href="https://github.com/instructure/canvas-lms/blob/master/app/controllers/discussion_topics_api_controller.rb">DiscussionTopicsApiController#mark_all_topic_read</a></span> </h2> <h3 class='endpoint'> PUT /api/v1/courses/:course_id/discussion_topics/read_all </h3> <div> <strong>Scope: </strong> <code class="scope">url:PUT|/api/v1/courses/:course_id/discussion_topics/read_all</code> </div> <h3 class='endpoint'> PUT /api/v1/groups/:group_id/discussion_topics/read_all </h3> <div> <strong>Scope: </strong> <code class="scope">url:PUT|/api/v1/groups/:group_id/discussion_topics/read_all</code> </div> <p>Mark the initial text of all the discussion topics as read in the context.</p> <p>No request fields are necessary.</p> <p>On success, the response will be 204 No Content with an empty body.</p> <div class="examples"> <h4>Example Request:</h4> <h4><div class='inline'></div></h4> <pre class="example code prettyprint"><code class="language-bash">curl 'https://<canvas>/api/v1/courses/<course_id>/discussion_topics/read_all' \ -X POST \ -H "Authorization: Bearer <token>" \ -H "Content-Length: 0"</code></pre> </div> </div> <div class="method_details "> <h2 class='api_method_name' name='method.discussion_topics_api.mark_topic_unread' data-subtopic='Discussion Topics'> <a name='method.discussion_topics_api.mark_topic_unread' href='#method.discussion_topics_api.mark_topic_unread'> Mark topic as unread </a> <span class='defined-in'><a href="https://github.com/instructure/canvas-lms/blob/master/app/controllers/discussion_topics_api_controller.rb">DiscussionTopicsApiController#mark_topic_unread</a></span> </h2> <h3 class='endpoint'> DELETE /api/v1/courses/:course_id/discussion_topics/:topic_id/read </h3> <div> <strong>Scope: </strong> <code class="scope">url:DELETE|/api/v1/courses/:course_id/discussion_topics/:topic_id/read</code> </div> <h3 class='endpoint'> DELETE /api/v1/groups/:group_id/discussion_topics/:topic_id/read </h3> <div> <strong>Scope: </strong> <code class="scope">url:DELETE|/api/v1/groups/:group_id/discussion_topics/:topic_id/read</code> </div> <p>Mark the initial text of the discussion topic as unread.</p> <p>No request fields are necessary.</p> <p>On success, the response will be 204 No Content with an empty body.</p> <div class="examples"> <h4>Example Request:</h4> <h4><div class='inline'></div></h4> <pre class="example code prettyprint"><code class="language-bash">curl 'https://<canvas>/api/v1/courses/<course_id>/discussion_topics/<topic_id>/read.json' \ -X DELETE \ -H "Authorization: Bearer <token>"</code></pre> </div> </div> <div class="method_details "> <h2 class='api_method_name' name='method.discussion_topics_api.mark_all_read' data-subtopic='Discussion Topics'> <a name='method.discussion_topics_api.mark_all_read' href='#method.discussion_topics_api.mark_all_read'> Mark all entries as read </a> <span class='defined-in'><a href="https://github.com/instructure/canvas-lms/blob/master/app/controllers/discussion_topics_api_controller.rb">DiscussionTopicsApiController#mark_all_read</a></span> </h2> <h3 class='endpoint'> PUT /api/v1/courses/:course_id/discussion_topics/:topic_id/read_all </h3> <div> <strong>Scope: </strong> <code class="scope">url:PUT|/api/v1/courses/:course_id/discussion_topics/:topic_id/read_all</code> </div> <h3 class='endpoint'> PUT /api/v1/groups/:group_id/discussion_topics/:topic_id/read_all </h3> <div> <strong>Scope: </strong> <code class="scope">url:PUT|/api/v1/groups/:group_id/discussion_topics/:topic_id/read_all</code> </div> <p>Mark the discussion topic and all its entries as read.</p> <p>No request fields are necessary.</p> <p>On success, the response will be 204 No Content with an empty body.</p> <h4>Request Parameters:</h4> <table class="request-params"> <thead> <tr> <th class="param-name">Parameter</th> <th class="param-req"></th> <th class="param-type">Type</th> <th class="param-desc">Description</th> </tr> </thead> <tbody> <tr class="request-param "> <td>forced_read_state</td> <td> </td> <td>boolean</td> <td class="param-desc"> <p>A boolean value to set all of the entries’ forced_read_state. No change is made if this argument is not specified.</p> </td> </tr> </tbody> </table> <div class="examples"> <h4>Example Request:</h4> <h4><div class='inline'></div></h4> <pre class="example code prettyprint"><code class="language-bash">curl 'https://<canvas>/api/v1/courses/<course_id>/discussion_topics/<topic_id>/read_all.json' \ -X PUT \ -H "Authorization: Bearer <token>" \ -H "Content-Length: 0"</code></pre> </div> </div> <div class="method_details "> <h2 class='api_method_name' name='method.discussion_topics_api.mark_all_unread' data-subtopic='Discussion Topics'> <a name='method.discussion_topics_api.mark_all_unread' href='#method.discussion_topics_api.mark_all_unread'> Mark all entries as unread </a> <span class='defined-in'><a href="https://github.com/instructure/canvas-lms/blob/master/app/controllers/discussion_topics_api_controller.rb">DiscussionTopicsApiController#mark_all_unread</a></span> </h2> <h3 class='endpoint'> DELETE /api/v1/courses/:course_id/discussion_topics/:topic_id/read_all </h3> <div> <strong>Scope: </strong> <code class="scope">url:DELETE|/api/v1/courses/:course_id/discussion_topics/:topic_id/read_all</code> </div> <h3 class='endpoint'> DELETE /api/v1/groups/:group_id/discussion_topics/:topic_id/read_all </h3> <div> <strong>Scope: </strong> <code class="scope">url:DELETE|/api/v1/groups/:group_id/discussion_topics/:topic_id/read_all</code> </div> <p>Mark the discussion topic and all its entries as unread.</p> <p>No request fields are necessary.</p> <p>On success, the response will be 204 No Content with an empty body.</p> <h4>Request Parameters:</h4> <table class="request-params"> <thead> <tr> <th class="param-name">Parameter</th> <th class="param-req"></th> <th class="param-type">Type</th> <th class="param-desc">Description</th> </tr> </thead> <tbody> <tr class="request-param "> <td>forced_read_state</td> <td> </td> <td>boolean</td> <td class="param-desc"> <p>A boolean value to set all of the entries’ forced_read_state. No change is made if this argument is not specified.</p> </td> </tr> </tbody> </table> <div class="examples"> <h4>Example Request:</h4> <h4><div class='inline'></div></h4> <pre class="example code prettyprint"><code class="language-bash">curl 'https://<canvas>/api/v1/courses/<course_id>/discussion_topics/<topic_id>/read_all.json' \ -X DELETE \ -H "Authorization: Bearer <token>"</code></pre> </div> </div> <div class="method_details "> <h2 class='api_method_name' name='method.discussion_topics_api.mark_entry_read' data-subtopic='Discussion Topics'> <a name='method.discussion_topics_api.mark_entry_read' href='#method.discussion_topics_api.mark_entry_read'> Mark entry as read </a> <span class='defined-in'><a href="https://github.com/instructure/canvas-lms/blob/master/app/controllers/discussion_topics_api_controller.rb">DiscussionTopicsApiController#mark_entry_read</a></span> </h2> <h3 class='endpoint'> PUT /api/v1/courses/:course_id/discussion_topics/:topic_id/entries/:entry_id/read </h3> <div> <strong>Scope: </strong> <code class="scope">url:PUT|/api/v1/courses/:course_id/discussion_topics/:topic_id/entries/:entry_id/read</code> </div> <h3 class='endpoint'> PUT /api/v1/groups/:group_id/discussion_topics/:topic_id/entries/:entry_id/read </h3> <div> <strong>Scope: </strong> <code class="scope">url:PUT|/api/v1/groups/:group_id/discussion_topics/:topic_id/entries/:entry_id/read</code> </div> <p>Mark a discussion entry as read.</p> <p>No request fields are necessary.</p> <p>On success, the response will be 204 No Content with an empty body.</p> <h4>Request Parameters:</h4> <table class="request-params"> <thead> <tr> <th class="param-name">Parameter</th> <th class="param-req"></th> <th class="param-type">Type</th> <th class="param-desc">Description</th> </tr> </thead> <tbody> <tr class="request-param "> <td>forced_read_state</td> <td> </td> <td>boolean</td> <td class="param-desc"> <p>A boolean value to set the entry’s forced_read_state. No change is made if this argument is not specified.</p> </td> </tr> </tbody> </table> <div class="examples"> <h4>Example Request:</h4> <h4><div class='inline'></div></h4> <pre class="example code prettyprint"><code class="language-bash">curl 'https://<canvas>/api/v1/courses/<course_id>/discussion_topics/<topic_id>/entries/<entry_id>/read.json' \ -X PUT \ -H "Authorization: Bearer <token>"\ -H "Content-Length: 0"</code></pre> </div> </div> <div class="method_details "> <h2 class='api_method_name' name='method.discussion_topics_api.mark_entry_unread' data-subtopic='Discussion Topics'> <a name='method.discussion_topics_api.mark_entry_unread' href='#method.discussion_topics_api.mark_entry_unread'> Mark entry as unread </a> <span class='defined-in'><a href="https://github.com/instructure/canvas-lms/blob/master/app/controllers/discussion_topics_api_controller.rb">DiscussionTopicsApiController#mark_entry_unread</a></span> </h2> <h3 class='endpoint'> DELETE /api/v1/courses/:course_id/discussion_topics/:topic_id/entries/:entry_id/read </h3> <div> <strong>Scope: </strong> <code class="scope">url:DELETE|/api/v1/courses/:course_id/discussion_topics/:topic_id/entries/:entry_id/read</code> </div> <h3 class='endpoint'> DELETE /api/v1/groups/:group_id/discussion_topics/:topic_id/entries/:entry_id/read </h3> <div> <strong>Scope: </strong> <code class="scope">url:DELETE|/api/v1/groups/:group_id/discussion_topics/:topic_id/entries/:entry_id/read</code> </div> <p>Mark a discussion entry as unread.</p> <p>No request fields are necessary.</p> <p>On success, the response will be 204 No Content with an empty body.</p> <h4>Request Parameters:</h4> <table class="request-params"> <thead> <tr> <th class="param-name">Parameter</th> <th class="param-req"></th> <th class="param-type">Type</th> <th class="param-desc">Description</th> </tr> </thead> <tbody> <tr class="request-param "> <td>forced_read_state</td> <td> </td> <td>boolean</td> <td class="param-desc"> <p>A boolean value to set the entry’s forced_read_state. No change is made if this argument is not specified.</p> </td> </tr> </tbody> </table> <div class="examples"> <h4>Example Request:</h4> <h4><div class='inline'></div></h4> <pre class="example code prettyprint"><code class="language-bash">curl 'https://<canvas>/api/v1/courses/<course_id>/discussion_topics/<topic_id>/entries/<entry_id>/read.json' \ -X DELETE \ -H "Authorization: Bearer <token>"</code></pre> </div> </div> <div class="method_details "> <h2 class='api_method_name' name='method.discussion_topics_api.rate_entry' data-subtopic='Discussion Topics'> <a name='method.discussion_topics_api.rate_entry' href='#method.discussion_topics_api.rate_entry'> Rate entry </a> <span class='defined-in'><a href="https://github.com/instructure/canvas-lms/blob/master/app/controllers/discussion_topics_api_controller.rb">DiscussionTopicsApiController#rate_entry</a></span> </h2> <h3 class='endpoint'> POST /api/v1/courses/:course_id/discussion_topics/:topic_id/entries/:entry_id/rating </h3> <div> <strong>Scope: </strong> <code class="scope">url:POST|/api/v1/courses/:course_id/discussion_topics/:topic_id/entries/:entry_id/rating</code> </div> <h3 class='endpoint'> POST /api/v1/groups/:group_id/discussion_topics/:topic_id/entries/:entry_id/rating </h3> <div> <strong>Scope: </strong> <code class="scope">url:POST|/api/v1/groups/:group_id/discussion_topics/:topic_id/entries/:entry_id/rating</code> </div> <p>Rate a discussion entry.</p> <p>On success, the response will be 204 No Content with an empty body.</p> <h4>Request Parameters:</h4> <table class="request-params"> <thead> <tr> <th class="param-name">Parameter</th> <th class="param-req"></th> <th class="param-type">Type</th> <th class="param-desc">Description</th> </tr> </thead> <tbody> <tr class="request-param "> <td>rating</td> <td> </td> <td>integer</td> <td class="param-desc"> <p>A rating to set on this entry. Only 0 and 1 are accepted.</p> </td> </tr> </tbody> </table> <div class="examples"> <h4>Example Request:</h4> <h4><div class='inline'></div></h4> <pre class="example code prettyprint"><code class="language-bash">curl 'https://<canvas>/api/v1/courses/<course_id>/discussion_topics/<topic_id>/entries/<entry_id>/rating.json' \ -X POST \ -H "Authorization: Bearer <token>"</code></pre> </div> </div> <div class="method_details "> <h2 class='api_method_name' name='method.discussion_topics_api.subscribe_topic' data-subtopic='Discussion Topics'> <a name='method.discussion_topics_api.subscribe_topic' href='#method.discussion_topics_api.subscribe_topic'> Subscribe to a topic </a> <span class='defined-in'><a href="https://github.com/instructure/canvas-lms/blob/master/app/controllers/discussion_topics_api_controller.rb">DiscussionTopicsApiController#subscribe_topic</a></span> </h2> <h3 class='endpoint'> PUT /api/v1/courses/:course_id/discussion_topics/:topic_id/subscribed </h3> <div> <strong>Scope: </strong> <code class="scope">url:PUT|/api/v1/courses/:course_id/discussion_topics/:topic_id/subscribed</code> </div> <h3 class='endpoint'> PUT /api/v1/groups/:group_id/discussion_topics/:topic_id/subscribed </h3> <div> <strong>Scope: </strong> <code class="scope">url:PUT|/api/v1/groups/:group_id/discussion_topics/:topic_id/subscribed</code> </div> <p>Subscribe to a topic to receive notifications about new entries</p> <p>On success, the response will be 204 No Content with an empty body</p> <div class="examples"> <h4>Example Request:</h4> <h4><div class='inline'></div></h4> <pre class="example code prettyprint"><code class="language-bash">curl 'https://<canvas>/api/v1/courses/<course_id>/discussion_topics/<topic_id>/subscribed.json' \ -X PUT \ -H "Authorization: Bearer <token>" \ -H "Content-Length: 0"</code></pre> </div> </div> <div class="method_details "> <h2 class='api_method_name' name='method.discussion_topics_api.unsubscribe_topic' data-subtopic='Discussion Topics'> <a name='method.discussion_topics_api.unsubscribe_topic' href='#method.discussion_topics_api.unsubscribe_topic'> Unsubscribe from a topic </a> <span class='defined-in'><a href="https://github.com/instructure/canvas-lms/blob/master/app/controllers/discussion_topics_api_controller.rb">DiscussionTopicsApiController#unsubscribe_topic</a></span> </h2> <h3 class='endpoint'> DELETE /api/v1/courses/:course_id/discussion_topics/:topic_id/subscribed </h3> <div> <strong>Scope: </strong> <code class="scope">url:DELETE|/api/v1/courses/:course_id/discussion_topics/:topic_id/subscribed</code> </div> <h3 class='endpoint'> DELETE /api/v1/groups/:group_id/discussion_topics/:topic_id/subscribed </h3> <div> <strong>Scope: </strong> <code class="scope">url:DELETE|/api/v1/groups/:group_id/discussion_topics/:topic_id/subscribed</code> </div> <p>Unsubscribe from a topic to stop receiving notifications about new entries</p> <p>On success, the response will be 204 No Content with an empty body</p> <div class="examples"> <h4>Example Request:</h4> <h4><div class='inline'></div></h4> <pre class="example code prettyprint"><code class="language-bash">curl 'https://<canvas>/api/v1/courses/<course_id>/discussion_topics/<topic_id>/subscribed.json' \ -X DELETE \ -H "Authorization: Bearer <token>"</code></pre> </div> </div> </div> </div> </div> <script type="text/javascript"> $('h2.api_method_name').each(function(i, el) { var subtopic = $(el).data('subtopic'); var $a = $(el).find('a'); if ($.trim($a[0].innerHTML) == '') return; var $row = $('table#quicklinks tr').filter(function() { return $(this).data('subtopic') == subtopic; }); if ($row.length == 0) { $row = $('<tr/>').appendTo($('table#quicklinks')); $row.data('subtopic', subtopic); $('<th/>').append(subtopic).appendTo($row); $('<td/>').appendTo($row); } var link = $('<a/>').attr('href', '#'+$(el).attr('name')).append($.trim($a[0].innerHTML)); $row.find('td').append(link); }); </script> <div id="footer"> © Instructure, Inc. Generated on Tue Aug 27 19:26:57 2024<br> This documentation is generated directly from the Canvas LMS source code, available <a href="https://github.com/instructure/canvas-lms">on Github</a>. </div> </body> </html>