Attributes¶
- Discussions.Forum¶
When you use actions that retrieve Forum information, the service provides a block like this:
{ "ForumId": <number:D2LID>, "StartDate": <string:UTCDateTime>|null, "EndDate": <string:UTCDateTime>|null, "PostStartDate": <string:UTCDateTime>|null, "PostEndDate": <string:UTCDateTime>|null, "Name": <string>, "Description": { <composite:RichText> }, "ShowDescriptionInTopics": <boolean>|null, "AllowAnonymous": <boolean>, "IsLocked": <boolean>, "IsHidden": <boolean>, "RequiresApproval": <boolean>, "DisplayInCalendar": <boolean>, "DisplayPostDatesInCalendar": <boolean>, "StartDateAvailabilityType": <string:AVAILABILITY_T>|null, "EndDateAvailabilityType": <string:AVAILABILITY_T>|null }
- StartDateAvailabilityType, EndDateAvailabilityType
Identifies the availability type (AVAILABILITY_T) for the start and end date values for the discussion forum.
- Discussions.ForumData¶
When you use actions that create or edit a Forum on the service, you should provide a block that looks like this:
{ "Name": <string>, "Description": { <composite:RichText> }, "ShowDescriptionInTopics": <boolean>|null, "StartDate": <string:UTCDateTime>|null, "EndDate": <string:UTCDateTime>|null, "PostStartDate": <string:UTCDateTime>|null, "PostEndDate": <string:UTCDateTime>|null, "AllowAnonymous": <boolean>, "IsLocked": <boolean>, "IsHidden": <boolean>, "RequiresApproval": <boolean>, "MustPostToParticipate": <boolean>|null, "DisplayInCalendar": <boolean>|null, "DisplayPostDatesInCalendar": <boolean>|null, "StartDateAvailabilityType": <string:AVAILABILITY_T>|null, "EndDateAvailabilityType": <string:AVAILABILITY_T>|null }
- Description
Note that this property requires a RichText structure, and follows this general behaviour: if you provide a value for the Html property, the new forum will use that; otherwise, the new forum will use the value of the Text property.
- ShowDescriptionInTopics
If true, the forum’s description (if present) will be displayed above the topic description when viewing topics in the Discussions tool. Default is false.
- DisplayInCalendar
If true, the start date and end date of the forum (if they exist) will appear in the calendars of all users who can see the forum. Default is false. This cannot be true if neither start date nor end date is provided (400 error).
- DisplayPostDatesInCalendar
This property is no longer used with LE API v1.56 and forward. If true, the posting start date and posting end date of the forum (if they exist) will appear in the calendars of all users who can see the forum. Default is false. This cannot be true if neither post start date nor post end date is provided (400 error).
- IsLocked
This property is no longer used with LE API v1.56 and forward; when sent from the back-end service, this property will always have a false value; when sent to the back-end service, the service will ignore whatever value you send.
- MustPostToParticipate
If true, the contents of the forum won’t be visible to a user until the user creates a post for the forum; otherwise, if the user has permission to view the forum, the forum’s posts will be visible whether or not the user has posted. This cannot be set to true if AllowAnonymous is also set to true (400 error).
- PostStartDate, PostEndDate
These properties are no longer used with LE API v1.56 and forward; when sent from the back-end service, these properties will always have null values; when sent to the back-end service, the service will ignore whatever value you send.
- StartDate, EndDate, StartDateAvailabilityType, EndDateAvailabilityType
Starting with LE API v1.56, if you provide start and end date values, you should also provide values for the corresponding availability type fields (see following); if you do not provide type values the back end service uses the default availability type configured for the appropriate org unit.
Note
The back-end service will apply the values you provide in these fields, overwriting the date properties stored in the service, and if you provide null for a date field (or do not provide one in the structure you send), the service will remove the associated date property’s value it has stored for the discussion.
- Discussions.CopyForumData¶
When you use an action to copy a discussion forum, you should provide a block that looks like this:
{ "IncludeTopics": <boolean>, "IncludePinnedThreads": <boolean> }
- IncludeTopics
If true, all topics within the forum will also be copied to the new forum. If false, only the forum itself is copied (without any topics).
- IncludePinnedThreads
If true, any pinned threads in the forum’s topics will also be copied. This property is only relevant when IncludeTopics is also true.
- Discussions.DeletedDiscussionsData¶
When you use actions that retrieve deleted discussions for an org unit, the service provides blocks like this:
{ "DeletedForums": [ { "ForumId": <number:D2LID>, "Name": <string>, "DeletedDate": <string:UTCDateTime>, "DeletedByUserId": <number:D2LID>|null, "TopicCount": <number>, }, ... ], "DeletedTopics": [ { "TopicId": <number:D2LID>, "ParentForumId": <number:D2LID>, "Name": <string>, "DeletedDate": <string:UTCDateTime>, "DeletedByUserId": <number:D2LID>|null }, ... ] }
- TopicCount
The number of topics within the deleted forum.
Topics¶
- RATING_T¶
Discussion topics can be rated in different ways, classified by type. We use the term RATING_T to stand in for an appropriate integer value.
Rating type
Value
None
0
FiveStar
1
UpVoteDownVote
2
UpVoteOnly
3
- SCORING_T¶
Discussion topics can have their aggregate score calculated in different ways, classified by type. We use the term SCORING_T to stand in for an appropriate integer value.
Scoring type
Value
AverageMessageScore
1
MaximumMessageScore
2
MinimumMessageScore
3
ModeHighestMessageScore
4
ModeLowestMessageScore
5
SumOfMessageScores
6
- Discussions.Topic¶
When you use an action to retrieve information about a discussion forum topic, the service sends you a block that looks like this:
{ "ForumId": <number:D2LID>, "TopicId": <number:D2LID>, "Name": <string>, "Description": { <composite:RichText> }, "StartDate": <string:UTCDateTime>|null, "EndDate": <string:UTCDateTime>|null, "UnlockStartDate": <string:UTCDateTime>|null, "UnlockEndDate": <string:UTCDateTime>|null, "IsLocked": <boolean>, "AllowAnonymousPosts": <boolean>, "RequiresApproval": <boolean>, "UnApprovedPostCount": <number>, "PinnedPostCount": <number>, "ScoringType": <string:SCORING_T>, "IsAutoScore": <boolean>, "ScoreOutOf": <number>|null, "IncludeNonScoredValues": <boolean>, "ScoredCount": <number>, "RatingsSum": <number>, "RatingsCount": <number>, "IsHidden": <boolean>, "MustPostToParticipate": <boolean>, "RatingType": <string:RATING_T>, "ActivityId": <string>|null, "GroupTypeId": <number:D2LID>|null, "StartDateAvailabilityType": <string:AVAILABILITY_T>|null, "EndDateAvailabilityType": <string:AVAILABILITY_T>|null, "DueDate": <string:UTCDateTime>|null // Added with LE API v1.90 }
- ActivityId
If not null, identifies the underlying activity for this discussion topic.
- GroupTypeId
If set, it specifies that the topic is associated with a group category. The group category specified will be in the same org unit as the topic. This field appears only with LE version 1.29 and forward.
- MustPostToParticipate
If true, the contents of the topic won’t be visible to a user until the user creates a post for the topic; otherwise, if the user has permission to view the topic, the topic’s posts will be visible whether or not the user has posted.
- StartDateAvailabilityType, EndDateAvailabilityType
Identifies the availability type (AVAILABILITY_T) for the start and end date values for the discussion topic.
- Discussions.CreateTopicData¶
When you use an action to create a new forum topic, or update an existing one, you should provide a block that looks like this:
{ "Name": <string>, "Description": { <composite:RichTextInput> }, "AllowAnonymousPosts": <boolean>, "StartDate": <string:UTCDateTime>|null, "EndDate": <string:UTCDateTime>|null, "IsHidden": <boolean>, "UnlockStartDate": <string:UTCDateTime>|null, "UnlockEndDate": <string:UTCDateTime>|null, "RequiresApproval": <boolean>, "ScoreOutOf": <number>|null, "IsAutoScore": <boolean>, "IncludeNonScoredValues": <boolean>, "ScoringType": <string:SCORING_T>|null, "IsLocked": <boolean>, "MustPostToParticipate": <boolean>, "RatingType": <string:RATING_T>|null, "DisplayInCalendar": <boolean>|null, "DisplayUnlockDatesInCalendar": <boolean>|null, "GroupTypeId": <number:D2LID>|null, "StartDateAvailabilityType": <string:AVAILABILITY_T>|null, "EndDateAvailabilityType": <string:AVAILABILITY_T>|null, "DueDate": <string:UTCDateTime>|null // Added with LE API v1.90 }
- Description
Note that this property uses the RichTextInput structure type.
- DisplayInCalendar
If true, the start date and end date of the topic (if they exist) will appear in the calendars of all users who can see the topic. Default is false. This cannot be true if neither start date nor end date is provided (400 error).
- DisplayUnlockDatesInCalendar
If true, the unlock start date and unlock end date of the topic (if they exist) will appear in the calendars of all users who can see the topic. Default is false. This cannot be true if neither unlock start date nor unlock end date is provided (400 error).
- DueDate
If this property is present and not null, the topic has a due date for posting. If the property is present with a non-null value then it must be after the start date and before, or equal to, the end date. It contains a UTCDateTime.
- GroupTypeId
If set, it specifies that the topic is associated with a group category. The group category specified must be in the same org unit as the topic. This field is supported on input only with LE version 1.29 and forward.
- IsLocked
This property is no longer used with LE API v1.56 and forward; when sent from the back-end service, this property will always have a false value; when sent to the back-end service, the service will ignore whatever value you send.
- MustPostToParticipate
If true, the contents of the topic won’t be visible to a user until the user creates a post for the topic; otherwise, if the user has permission to view the topic, the topic’s posts will be visible whether or not the user has posted. This cannot be set to true if AllowAnonymous is also set to true (400 error).
- RatingType
If null, this topic inherents the org unit’s default rating type. If not null, sets the rating type for this discussion topic.
- ScoringType
Note that although this property gets passed as a string, you should use the appropriate numeric value for the topic’s scoring type.
- StartDate, EndDate, StartDateAvailabilityType, EndDateAvailabilityType
Starting with LE API v1.56, if you provide start and end date values, you should also provide values for the corresponding availability type fields; if you do not provide type values the back end service uses the default availability type configured for the appropriate org unit.
- UnlockStartDate, UnlockEndDate
These properties are no longer used with LE API v1.56 and forward; when sent from the back-end service, these properties will always have null values; when sent to the back-end service, the service will ignore whatever value you send.
- Discussions.CopyTopicData¶
When you use an action to copy a discussion topic, you should provide a block that looks like this:
{ "TargetForumId": <number:D2LID>, "IncludePinnedThreads": <boolean> }
- TargetForumId
The ID of the forum into which the copied topic should be placed.
- IncludePinnedThreads
If true, any pinned threads in the topic will also be copied to the new topic.
- Discussions.GroupRestriction¶
{ "GroupId": <number:D2LID> }
Posts¶
Posts can be either a thread (a post directly under a topic), or a simple post in reply to another post (including a thread). Posts and threads have the same properties and representations, and the term post will be used to refer to both.
- POSTVOTE_T¶
Posts can receive votes of varying types. We use the term POSTVOTE_T to stand for an appropriate integer value.
Post vote type
Value
UpVote
1
NoVote
0
DownVote
-1
- Discussions.ApprovalData¶
{ "IsApproved": <boolean> }
- Discussions.CreatePostData¶
When you use an action to create a new post in a discussion forum, you should provide a block that looks like this:
{ "ParentPostId": <number:D2LID>|null, "Subject": <string>, "Message": { <composite:RichTextInput> }, "IsAnonymous": <boolean> }
- Message
Note that this property uses the RichTextInput structure type.
- Discussions.FlagData¶
{ "IsFlagged": <boolean> }
- Discussions.Post¶
When you use an action that retrieves information about a discussion forum post, the service sends you a block that looks like this:
{ "ForumId": <number:D2LID>, "PostId": <number:D2LID>, "TopicId": <number:D2LID>, "PostingUserId": <number:D2LID>|null, "PostingUserDisplayName": <string>, "ThreadId": <number:D2LID>, "ParentPostId": <number:D2LID>|null, "Message": { <composite:RichText> }, "Subject": <string>, "DatePosted": <string:UTCDateTime>, "IsAnonymous": <boolean>, "RequiresApproval": <boolean>, "IsDeleted": <boolean>, "LastEditedDate": <string:UTCDateTime>|null, "LastEditedBy": <number:D2LID>|null, "CanRate": <boolean>, "ReplyPostIds": [ <number:D2LID>, ... ], "WordCount": <number:D2LID>, "AttachmentCount": <number:D2LID>, "IsRead": <boolean>, // Added with LE API v1.45 "Attachments": [ // Added with LE API v1.95 { <composite:Discussions.PostAttachment> }, ... ] "ThreadIsPinned": <boolean> // Added with LE API v1.95 }
- ThreadIsPinned
Indicates whether the post’s parent thread is pinned. This is a thread-level attribute: all posts (root post and replies) within a pinned thread return
true. Only present when using API version 1.95 or higher.- LastEditedBy
If present, the User ID for the user who last edited the post.
- PostingUserDisplayName
The string for a user’s display name that the calling user would see in the Web UI.
- Attachments
An array of
PostAttachmentblocks describing the files attached to this post. Added with LE API v1.95.
- Discussions.PostAttachment¶
When you use an action to retrieve a discussion forum post the
Postblock may include an array of attachment blocks that look like this:{ "FileId": <number:D2LID>, "FileName": <string>, "Size": <number> }
- Size
The size of the attached file in bytes.
- Discussions.RatingData¶
{ "CanRate": <boolean>, "RatingsSum": <number>, "RatingsCount": <number>, "RatingsAverage": <number>, "UserRating": { <composite:Discussion.UserRatingData> } }
- Discussions.ReadStatusData¶
{ "IsRead": <boolean> }
- Discussions.UpdatePostData¶
When you use an action to update an existing discussion forum post, you should send a block that looks like this:
{ "Subject": <string>, "Message": { <composite:RichTextInput> } }
- Message
Note that this property uses the RichTextInput structure type.
- Discussions.UserRatingData¶
{ "Rating": <number>|null }
- Rating
Discuss ratings can have a value of 1 through 5, inclusive. If you provide 0 when providing or updating a rating value, the service removes the rating and treats the discussion as unrated.
- Discussions.UserVoteData¶
{ "Vote": <string:POSTVOTE_T> }
- Discussions.VotesData¶
{ "NumUpVotes": <number>, "NumDwnVotes": <number>, "UserVote": { <composite:Discussion.UserVoteData> } }
Statistics¶
- Discussions.OrgUnitOverallStats¶
When you use the action to retrieve overall discussion statistics for an org unit, the service provides a block like this:
{ "TotalThreads": <number:int>, "TotalReplies": <number:int>, "TotalPinned": <number:int>, "UnapprovedPosts": <number:int> }
- TotalThreads, TotalReplies, TotalPinned
Total number of threads, replies, and pinned threads across all forums and topics in the org unit.
- UnapprovedPosts
The total number of unapproved posts across all forums and topics in the org unit.
- Discussions.OrgUnitUserStats¶
When you use the action to retrieve per-user discussion statistics for an org unit, the service provides a JSON array of blocks like this:
{ "UserId": <number:long>, "DisplayName": <string>, "ThreadsPosted": <number:int>, "RepliesPosted": <number:int>, "PostsReadCount": <number:int>, "UnapprovedPostCount": <number:int>, "ScoredPostCount": <number:int> }
- Discussions.OrgUnitForumStats¶
When you use the action to retrieve forum and topic statistics for an org unit, the service provides a JSON array of blocks like this:
{ "ForumId": <number:long>, "Name": <string>, "Threads": <number:int>, "Replies": <number:int>, "Pinned": <number:int>, "Unapproved": <number:int>, "Scored": <number:int>, "TopicStatistics": [ { <composite:Discussions.OrgUnitTopicStats> }, ... ] }
- TopicStatistics
An array of
OrgUnitTopicStatsblocks for the topics within this forum. Forums are sorted by forum sort order; topics within each forum are sorted by topic sort order ascending.
- Discussions.OrgUnitTopicStats¶
{ "TopicId": <number:long>, "Name": <string>, "Threads": <number:int>, "Replies": <number:int>, "Pinned": <number:int>, "Unapproved": <number:int>, "Scored": <number:int>, "UpVotes": <number:int>|null, "DownVotes": <number:int>|null, "AverageStarRating": <number:decimal>|null, "NumberOfRatings": <number:int> }
- UpVotes
Total up votes for the topic. Present only when the topic’s rating type is UpVoteOnly or UpVoteDownVote; null otherwise.
- DownVotes
Total down votes for the topic. Present only when the topic’s rating type is UpVoteDownVote; null otherwise.
- AverageStarRating
Average star rating for the topic. Present only when the topic’s rating type is FiveStar and there are ratings; null otherwise.
- Discussions.TopicStats¶
When you use the action to retrieve statistics for a specific discussion topic, the service provides a block like this:
{ "TotalThreads": <number:int>, "TotalReplies": <number:int>, "PinnedThreads": <number:int>, "UnapprovedPosts": <number:int>, "TotalUpVotes": <number:int>|null, "TotalDownVotes": <number:int>|null, "AverageFiveStarRating": <number:decimal>|null }
- TotalUpVotes
Total up votes across all posts in the topic. Present only when the topic’s rating type is UpVoteOnly or UpVoteDownVote; null otherwise.
- TotalDownVotes
Total down votes across all posts in the topic. Present only when the topic’s rating type is UpVoteDownVote; null otherwise.
- AverageFiveStarRating
Average star rating across all posts in the topic. Present only when the topic’s rating type is FiveStar and there are ratings; null otherwise.
- Discussions.TopicUserStats¶
When you use the action to retrieve per-user statistics for a specific discussion topic, the service provides a JSON array of blocks like this:
{ "UserId": <number:long>, "DisplayName": <string>, "ThreadsPosted": <number:int>, "RepliesPosted": <number:int>, "PostsReadCount": <number:int>, "UnapprovedPostCount": <number:int>, "ScoredPostCount": <number:int>, "UpVotes": <number:int>|null, "DownVotes": <number:int>|null, "StarRating": <number:decimal>|null, "StarRatingsCount": <number:int>|null }
- UpVotes
Up votes received on the user’s posts. Present only when the topic’s rating type is UpVoteOnly or UpVoteDownVote; null otherwise.
- DownVotes
Down votes received on the user’s posts. Present only when the topic’s rating type is UpVoteDownVote; null otherwise.
- StarRating
The user’s average star rating. Present only when the topic’s rating type is FiveStar (0 if no ratings yet); null otherwise.
- StarRatingsCount
Number of star ratings received by the user. Present only when the topic’s rating type is FiveStar; null otherwise.
- Discussions.ForumStats¶
When you use the action to retrieve statistics for a specific discussion forum, the service provides a block like this:
{ "TotalThreadsAllForums": <number:int>, "TotalRepliesAllForums": <number:int>, "TotalThreadsThisForum": <number:int>, "TotalRepliesThisForum": <number:int>, "PinnedThreads": <number:int>, "UnapprovedPosts": <number:int>, "TopicIds": [ <number:long>, ... ] }
- TotalThreadsAllForums, TotalRepliesAllForums
Total number of threads and replies across all forums in the org unit.
- TotalThreadsThisForum, TotalRepliesThisForum, PinnedThreads, UnapprovedPosts
Total number of threads, replies, pinned threads, and unapproved posts in the specified forum.
- TopicIds
IDs of all topics belonging to the specified forum.
Actions¶
- DELETE /d2l/api/le/(version)/(orgUnitId)/discussions/forums/(forumId)¶
Delete a particular discussion forum from an org unit.
- Parameters:
version (D2LVERSION) – API version.
orgUnitId (D2LID) – Org unit ID.
- Oauth2 Scopes:
discussions:forums:manage
- Status Codes:
200 OK – Action succeeded.
403 Forbidden – No permission to delete forums.
404 Not Found – Forum not found, or org unit not found.
429 Too Many Requests – API call-rate limit exceeded.
- API Versions:
1.82+ – Route first appears in LMS v20.25.1.
1.75-81 – Deprecated as of LMS v20.26.1.
1.74- – Obsolete as of LMS v20.26.1.
Note
Deleting a forum also deletes all its topics.
As of LMS v20.23.4 applications should use the discussions:forums:manage scope to gain access to this action. While the discussions:forums:read scope will still provide access, use of discussions:forums:read for this action is now deprecated.
- GET /d2l/api/le/(version)/(orgUnitId)/discussions/deleted¶
Retrieve deleted discussion forums and topics for an org unit.
- Parameters:
version (D2LVERSION) – API version.
orgUnitId (D2LID) – Org unit ID.
- Oauth2 Scopes:
discussions:forums:manage
- Status Codes:
200 OK – Action succeeded.
403 Forbidden – No permission to view deleted discussions for the org unit.
404 Not Found – Org unit not found.
429 Too Many Requests – API call-rate limit exceeded.
- API Versions:
1.95+ – Route first appears in LMS v20.26.6.
Return. This action returns a
DeletedDiscussionsDataJSON block containing the all the deleted forums and topics associated with the provided org unit.
- GET /d2l/api/le/(version)/(orgUnitId)/discussions/forums/¶
Retrieve a list of all discussion forums for an org unit.
- Parameters:
version (D2LVERSION) – API version.
orgUnitId (D2LID) – Org unit ID.
- Oauth2 Scopes:
discussions:forums:readonly
- Status Codes:
200 OK – Action succeeded.
403 Forbidden – No permission to see forums.
429 Too Many Requests – API call-rate limit exceeded.
- API Versions:
1.82+ – Route first appears in LMS v20.25.1.
1.75-81 – Deprecated as of LMS v20.26.1.
1.74- – Obsolete as of LMS v20.26.1.
Return. This action returns a JSON array of
Forumdata blocks for all the discussion forums associated with the provided org unit.Note
As of LMS v20.23.4 applications should use the discussions:forums:readonly scope to gain access to this action. While the discussions:forums:read scope will still provide access, use of discussions:forums:read for this action is now deprecated.
- GET /d2l/api/le/(version)/(orgUnitId)/discussions/forums/(forumId)¶
Retrieve a particular discussion forum for an org unit.
- Parameters:
version (D2LVERSION) – API version.
orgUnitId (D2LID) – Org unit ID.
- Oauth2 Scopes:
discussions:forums:readonly
- Status Codes:
200 OK – Action succeeded.
403 Forbidden – No permission to see forums.
404 Not Found – Forum not found, or org unit not found.
429 Too Many Requests – API call-rate limit exceeded.
- API Versions:
1.82+ – Route first appears in LMS v20.25.1.
1.75-81 – Deprecated as of LMS v20.26.1.
1.74- – Obsolete as of LMS v20.26.1.
Return. This action returns a
Forumdata block for the indicated discussion forum.Note
As of LMS v20.23.4 applications should use the discussions:forums:readonly scope to gain access to this action. While the discussions:forums:read scope will still provide access, use of discussions:forums:read for this action is now deprecated.
- GET /d2l/api/le/(version)/(orgUnitId)/discussions/forums/(forumId)/access/¶
Retrieve a list of users with access to a specified forum.
- Parameters:
version (D2LVERSION) – API version.
orgUnitId (D2LID) – Org unit ID.
forumId (D2LID) – Forum ID.
- Query Parameters:
- Oauth2 Scopes:
discussions:access:read
- Status Codes:
200 OK – Action succeeded.
403 Forbidden – No permission to see and manage forum, see classlist, view user enrollment.
404 Not Found – Unable to find the forum within specified org unit.
429 Too Many Requests – API call-rate limit exceeded.
- API Versions:
1.82+ – Route first appears in LMS v20.25.1.
1.75-81 – Deprecated as of LMS v20.26.1.
1.74- – Obsolete as of LMS v20.26.1.
Return. This action returns a
object list pagecontaining the resultingUserAccessblocks for the segment following your bookmark parameter (or the first segment if that parameter is empty or missing).
- POST /d2l/api/le/(version)/(orgUnitId)/discussions/forums/¶
Create a new forum for an org unit.
- Parameters:
version (D2LVERSION) – API version.
orgUnitId (D2LID) – Org unit ID.
- JSON Parameters:
ForumData (
Discussions.ForumData) – New discussion forum properties.
- Oauth2 Scopes:
discussions:forums:manage
- Status Codes:
200 OK – Action succeeded.
400 Bad Request – Invalid forum data provided.
403 Forbidden – No permission to create forums.
429 Too Many Requests – API call-rate limit exceeded.
- API Versions:
1.82+ – Route first appears in LMS v20.25.1.
1.75-81 – Deprecated as of LMS v20.26.1.
1.74- – Obsolete as of LMS v20.26.1.
Return. This action returns a
ForumJSON block containing the properties for the newly created discussion forum.Note
As of LMS v20.23.4 applications should use the discussions:forums:manage scope to gain access to this action. While the discussions:forums:read scope will still provide access, use of discussions:forums:read for this action is now deprecated.
- POST /d2l/api/le/(version)/(orgUnitId)/discussions/forums/(forumId)/order¶
Specify the position order of a discussion forum with respect to its sibling forums.
- Parameters:
version (D2LVERSION) – API version.
orgUnitId (D2LID) – Org unit ID.
forumId (D2LID) – Forum ID.
- Query Parameters:
position (string) – The order position within siblings and can be either first, last, or the forumId to be placed after.
- Oauth2 Scopes:
discussions:forums:manage
- Status Codes:
200 OK – Action succeeded.
400 Bad Request – The position value is not first or last, and cannot be resolved to a valid sibling forum ID.
403 Forbidden – No permission to manage forums.
404 Not Found – Unable to find the forum within specified org unit.
429 Too Many Requests – API call-rate limit exceeded.
- API Versions:
1.95+ – Route first appears in LMS v20.26.6.
Input. Provide a position query parameter value to indicate where in the forum sorting you want a target forum to have its position. You may specify one of three kinds of values: first to move the specified target forum to be first in order amongst its siblings; last to move the target forum to be last in order; or, provide a forum ID value to indicate the forum you want to be immediately before your target forum in the order.
Return. This action does not return a response body.
- POST /d2l/api/le/(version)/(orgUnitId)/discussions/forums/(forumId)/copy¶
Copy a discussion forum within an org unit.
- Parameters:
version (D2LVERSION) – API version.
orgUnitId (D2LID) – Org unit ID.
forumId (D2LID) – Forum ID.
- JSON Parameters:
CopyForumData (
Discussions.CopyForumData) – Options for copying the forum.
- Oauth2 Scopes:
discussions:forums:manage
- Status Codes:
200 OK – Action succeeded.
403 Forbidden – No permission to manage forums.
200 OK – Action succeeded.
Return. This action returns a
ForumJSON block containing the properties for the newly copied discussion forum. The new forum’s name will be prefixed with “Copy of”.
- POST /d2l/api/le/(version)/(orgUnitId)/discussions/forums/(forumId)/restore¶
Restore a deleted discussion forum in an org unit.
- Parameters:
version (D2LVERSION) – API version.
orgUnitId (D2LID) – Org unit ID.
forumId (D2LID) – Forum ID.
- Oauth2 Scopes:
discussions:forums:manage
- Status Codes:
200 OK – Action succeeded.
403 Forbidden – No permission to restore deleted forums.
400 Bad Request – Forum not eligible for restoration.
404 Not Found – Forum not found, or org unit not found.
429 Too Many Requests – API call-rate limit exceeded.
- API Versions:
1.95+ – Route first appears in LMS v20.26.6.
- PUT /d2l/api/le/(version)/(orgUnitId)/discussions/forums/(forumId)¶
Update a forum for an org unit.
- Parameters:
version (D2LVERSION) – API version.
orgUnitId (D2LID) – Org unit ID.
- JSON Parameters:
ForumData (
Discussions.ForumData) – Updated discussion forum properties.
- Oauth2 Scopes:
discussions:forums:manage
- Status Codes:
200 OK – Action succeeded.
400 Bad Request – Invalid forum data provided.
403 Forbidden – No permission to manage forums.
404 Not Found – Forum not found, or org unit not found.
429 Too Many Requests – API call-rate limit exceeded.
- API Versions:
1.82+ – Route first appears in LMS v20.25.1.
1.75-81 – Deprecated as of LMS v20.26.1.
1.74- – Obsolete as of LMS v20.26.1.
Input. The back-end service accepts, and applies, the date values you send (and if you don’t send any date properties, the service assumes a value of null for the missing date properties and will remove them from the forum).
Return. This action returns a
ForumJSON block containing the properties for the newly updated discussion forum.Note
As of LMS v20.23.4 applications should use the discussions:forums:manage scope to gain access to this action. While the discussions:forums:read scope will still provide access, use of discussions:forums:read for this action is now deprecated.
Topics¶
- DELETE /d2l/api/le/(version)/(orgUnitId)/discussions/forums/(forumId)/topics/(topicId)¶
Delete a particular topic from the provided discussion forum in an org unit.
- Parameters:
version (D2LVERSION) – API version.
orgUnitId (D2LID) – Org unit ID.
forumId (D2LID) – Forum ID.
topicId (D2LID) – Topic ID
- Oauth2 Scopes:
discussions:topics:manage
- Status Codes:
200 OK – Action succeeded.
404 Not Found – Topic not found, forum not found, or org unit not found.
429 Too Many Requests – API call-rate limit exceeded.
- API Versions:
1.82+ – Route first appears in LMS v20.25.1.
1.75-81 – Deprecated as of LMS v20.26.1.
1.74- – Obsolete as of LMS v20.26.1.
Note
As of LMS v20.23.4 applications should use the discussions:topics:manage scope to gain access to this action. While the discussions:topics:read scope will still provide access, use of discussions:topics:read for this action is now deprecated.
- DELETE /d2l/api/le/(version)/(orgUnitId)/discussions/forums/(forumId)/topics/(topicId)/groupRestrictions/¶
Delete a group restriction for a discussion forum topic.
- Parameters:
version (D2LVERSION) – API version.
orgUnitId (D2LID) – Org unit ID.
forumId (D2LID) – Forum ID.
topicId (D2LID) – Topic ID
- JSON Parameters:
GroupRestriction (
Discussions.GroupRestriction) – Group you want to remove from the group restriction list.
- Oauth2 Scopes:
discussions:group:manage
- Status Codes:
200 OK – Action succeeded.
403 Forbidden – No permission to create forums and topics.
404 Not Found – Topic not found, or forum not found, or org unit not found, or provided group not found.
429 Too Many Requests – API call-rate limit exceeded.
- API Versions:
1.82+ – Route first appears in LMS v20.25.1.
1.75-81 – Deprecated as of LMS v20.26.1.
1.74- – Obsolete as of LMS v20.26.1.
Note
You must provide a JSON post body with this delete request.
- GET /d2l/api/le/(version)/(orgUnitId)/discussions/forums/(forumId)/topics/(topicId)/access/¶
Retrieve a list of users with access to a specified topic within a forum.
- Parameters:
version (D2LVERSION) – API version.
orgUnitId (D2LID) – Org unit ID.
forumId (D2LID) – Forum ID.
topicId (D2LID) – Topic ID
- Query Parameters:
- Oauth2 Scopes:
discussions:access:read
- Status Codes:
200 OK – Action succeeded.
403 Forbidden – No permission to see and manage forum or topic, see classlist, view user enrollment.
404 Not Found – Unable to find the forum or topic within specified org unit.
429 Too Many Requests – API call-rate limit exceeded.
- API Versions:
1.82+ – Route first appears in LMS v20.25.1.
1.75-81 – Deprecated as of LMS v20.26.1.
1.74- – Obsolete as of LMS v20.26.1.
Return. This action returns a
object list pagecontaining the resultingUserAccessblocks for the segment following your bookmark parameter (or the first segment if that parameter is empty or missing).
- GET /d2l/api/le/(version)/(orgUnitId)/discussions/forums/(forumId)/topics/¶
Retrieve topics from the provided discussion forum in an org unit.
- Parameters:
version (D2LVERSION) – API version.
orgUnitId (D2LID) – Org unit ID.
forumId (D2LID) – Forum ID.
- Oauth2 Scopes:
discussions:topics:readonly
- Status Codes:
200 OK – Action succeeded.
403 Forbidden – No permission to see forum topics.
404 Not Found – No topics in forum, or forum not found, or org unit not found.
429 Too Many Requests – API call-rate limit exceeded.
- API Versions:
1.82+ – Route first appears in LMS v20.25.1.
1.75-81 – Deprecated as of LMS v20.26.1.
1.74- – Obsolete as of LMS v20.26.1.
Return. This action returns a JSON array of
Topicdata blocks containing the properties for some topics in the indicated discussion forum.Note
As of LMS v20.23.4 applications should use the discussions:topics:readonly scope to gain access to this action. While the discussions:topics:read scope will still provide access, use of discussions:topics:read for this action is now deprecated.
- GET /d2l/api/le/(version)/(orgUnitId)/discussions/forums/(forumId)/topics/(topicId)¶
Retrieve a particular topic from the provided discussion forum in an org unit.
- Parameters:
version (D2LVERSION) – API version.
orgUnitId (D2LID) – Org unit ID.
forumId (D2LID) – Forum ID.
topicId (D2LID) – Topic ID.
- Oauth2 Scopes:
discussions:topics:readonly
- Status Codes:
200 OK – Action succeeded.
403 Forbidden – No permission to see forum topics.
400 Bad Request – Topic not found, or forum not found, or org unit not found.
429 Too Many Requests – API call-rate limit exceeded.
- API Versions:
1.82+ – Route first appears in LMS v20.25.1.
1.75-81 – Deprecated as of LMS v20.26.1.
1.74- – Obsolete as of LMS v20.26.1.
Return. This action returns a
TopicJSON data block containing the properties for the indicated discussion forum topic.Note
As of LMS v20.23.4 applications should use the discussions:topics:readonly scope to gain access to this action. While the discussions:topics:read scope will still provide access, use of discussions:topics:read for this action is now deprecated.
- GET /d2l/api/le/(version)/(orgUnitId)/discussions/forums/(forumId)/topics/(topicId)/groupRestrictions/¶
Retrieve the group restrictions for a discussion forum topic.
- Parameters:
version (D2LVERSION) – API version.
orgUnitId (D2LID) – Org unit ID.
forumId (D2LID) – Forum ID.
topicId (D2LID) – Topic ID
- Oauth2 Scopes:
discussions:group:readonly
- Status Codes:
200 OK – Action succeeded.
403 Forbidden – No permission to create forums and topics.
404 Not Found – Topic not found, or org unit not found.
429 Too Many Requests – API call-rate limit exceeded.
- API Versions:
1.82+ – Route first appears in LMS v20.25.1.
1.75-81 – Deprecated as of LMS v20.26.1.
1.74- – Obsolete as of LMS v20.26.1.
Return. This action returns a JSON array of
GroupRestrictiondata blocks indicating all the groups in the topic’s group restriction list.
- POST /d2l/api/le/(version)/(orgUnitId)/discussions/forums/(forumId)/topics/¶
Create a new topic for the provided discussion forum in an org unit.
- Parameters:
version (D2LVERSION) – API version.
orgUnitId (D2LID) – Org unit ID.
forumId (D2LID) – Forum ID.
- JSON Parameters:
CreateTopicData (
Discussions.CreateTopicData) – New discussion topic properties.
- Oauth2 Scopes:
discussions:topics:manage
- Status Codes:
200 OK – Action succeeded.
400 Bad Request – Invalid topic data provided.
403 Forbidden – No permission to manage discussions.
404 Not Found – Forum not found, or org unit not found.
429 Too Many Requests – API call-rate limit exceeded.
- API Versions:
1.82+ – Route first appears in LMS v20.25.1.
1.75-81 – Deprecated as of LMS v20.26.1.
1.74- – Obsolete as of LMS v20.26.1.
Return. This action returns a
TopicJSON data block containing the properties for for the newly created topic.Note
As of LMS v20.23.4 applications should use the discussions:topics:manage scope to gain access to this action. While the discussions:topics:read scope will still provide access, use of discussions:topics:read for this action is now deprecated.
- POST /d2l/api/le/(version)/(orgUnitId)/discussions/forums/(forumId)/topics/(topicId)/copy¶
Copy a discussion topic within an org unit.
- Parameters:
version (D2LVERSION) – API version.
orgUnitId (D2LID) – Org unit ID.
forumId (D2LID) – Forum ID.
topicId (D2LID) – Topic ID.
- JSON Parameters:
CopyTopicData (
Discussions.CopyTopicData) – Options for copying the topic.
- Oauth2 Scopes:
discussions:topics:manage
- Status Codes:
200 OK – Action succeeded.
403 Forbidden – No permission to manage topics.
404 Not Found – Topic not found, target forum not found, or org unit not found.
429 Too Many Requests – API call-rate limit exceeded.
- API Versions:
1.95+ – Route first appears in LMS v20.26.6.
Return. This action returns a
TopicJSON data block containing the properties for the newly copied discussion topic. The new topic’s name will be prefixed with “Copy of”.Note
The TargetForumId in the input data specifies which forum the copied topic will be placed in. This can be different from the source forum.
- POST /d2l/api/le/(version)/(orgUnitId)/discussions/forums/(forumId)/topics/(topicId)/order¶
Specify the position order of a discussion topic with respect to its sibling topics.
- Parameters:
version (D2LVERSION) – API version.
orgUnitId (D2LID) – Org unit ID.
forumId (D2LID) – Forum ID.
topicId (D2LID) – Topic ID.
- Query Parameters:
position (string) – The order position within siblings and can be either first, last, or the topicId to be placed after.
- Oauth2 Scopes:
discussions:topics:manage
- Status Codes:
200 OK – Action succeeded.
400 Bad Request – The position value is not first or last, and cannot be resolved to a valid sibling topic ID.
403 Forbidden – No permission to manage topics.
404 Not Found – Unable to find the forum within specified org unit.
429 Too Many Requests – API call-rate limit exceeded.
- API Versions:
1.95+ – Route first appears in LMS v20.26.6.
Input. Provide a position query parameter value to indicate where in the topic sorting you want a target topic to have its position. You may specify one of three kinds of values: first to move the specified target topic to be first in order amongst its siblings; last to move the target topic to be last in order; or, provide a topic ID value to indicate the topic you want to be immediately before your target topic in the order.
Return. This action does not return a response body.
- POST /d2l/api/le/(version)/(orgUnitId)/discussions/forums/(forumId)/topics/(topicId)/restore¶
Restore a deleted discussion topic in a forum for an org unit.
- Parameters:
version (D2LVERSION) – API version.
orgUnitId (D2LID) – Org unit ID.
forumId (D2LID) – Forum ID.
topicId (D2LID) – Topic ID
- Oauth2 Scopes:
discussions:topics:manage
- Status Codes:
200 OK – Action succeeded.
403 Forbidden – No permission to restore deleted topics.
400 Bad Request – Topic not eligible for restoration.
404 Not Found – Topic not found, forum not found, or org unit not found.
429 Too Many Requests – API call-rate limit exceeded.
- API Versions:
1.95+ – Route first appears in LMS v20.26.6.
Note
A topic cannot be restored if its parent forum has been deleted.
- PUT /d2l/api/le/(version)/(orgUnitId)/discussions/forums/(forumId)/topics/(topicId)¶
Update an existing topic for the provided discussion forum in an org unit.
- Parameters:
version (D2LVERSION) – API version.
orgUnitId (D2LID) – Org unit ID.
forumId (D2LID) – Forum ID.
topicId (D2LID) – Topic ID
- JSON Parameters:
CreateTopicData (
Discussions.CreateTopicData) – Updated discussion topic properties.
- Oauth2 Scopes:
discussions:topics:manage
- Status Codes:
200 OK – Action succeeded.
400 Bad Request – Invalid topic data provided.
403 Forbidden – No permission to create forums and topics.
404 Not Found – Topic not found, or forum not found, or org unit not found.
429 Too Many Requests – API call-rate limit exceeded.
- API Versions:
1.82+ – Route first appears in LMS v20.25.1.
1.75-81 – Deprecated as of LMS v20.26.1.
1.74- – Obsolete as of LMS v20.26.1.
Return. This action returns a
TopicJSON data block containing the properties for the newly updated topic.Note
As of LMS v20.23.4 applications should use the discussions:topics:manage scope to gain access to this action. While the discussions:topics:read scope will still provide access, use of discussions:topics:read for this action is now deprecated.
- PUT /d2l/api/le/(version)/(orgUnitId)/discussions/forums/(forumId)/topics/(topicId)/groupRestrictions/¶
Add a group to the group restriction list for a discussion forum topic.
- Parameters:
version (D2LVERSION) – API version.
orgUnitId (D2LID) – Org unit ID.
forumId (D2LID) – Forum ID.
topicId (D2LID) – Topic ID
- JSON Parameters:
GroupRestriction (
Discussions.GroupRestriction) – Group you want to add to the group restriction list.
- Oauth2 Scopes:
discussions:group:manage
- Status Codes:
200 OK – Action succeeded.
403 Forbidden – No permission to create forums and topics.
404 Not Found – Topic not found, or org unit not found, or provided group not found.
429 Too Many Requests – API call-rate limit exceeded.
- API Versions:
1.82+ – Route first appears in LMS v20.25.1.
1.75-81 – Deprecated as of LMS v20.26.1.
1.74- – Obsolete as of LMS v20.26.1.
Posts¶
- DELETE /d2l/api/le/(version)/(orgUnitId)/discussions/forums/(forumId)/topics/(topicId)/posts/(postId)¶
Delete a particular post from a discussion forum topic.
- Parameters:
version (D2LVERSION) – API version.
orgUnitId (D2LID) – Org unit ID.
forumId (D2LID) – Forum ID.
topicId (D2LID) – Topic ID.
postId (D2LID) – Post ID.
- Oauth2 Scopes:
discussions:posts:manage
- Status Codes:
200 OK – Action succeeded.
403 Forbidden – No permission to delete identified post.
404 Not Found – Post not found.
429 Too Many Requests – API call-rate limit exceeded.
- API Versions:
1.82+ – Route first appears in LMS v20.25.1.
1.75-81 – Deprecated as of LMS v20.26.1.
1.74- – Obsolete as of LMS v20.26.1.
Note
As of LMS v20.23.4 applications should use the discussions:posts:manage scope to gain access to this action. While the discussions:posts:read scope will still provide access, use of discussions:posts:read for this action is now deprecated.
- DELETE /d2l/api/le/(version)/(orgUnitId)/discussions/forums/(forumId)/topics/(topicId)/posts/(postId)/Rating/MyRating¶
Delete the current user context’s rating for a particular post from a discussion forum topic.
- Parameters:
version (D2LVERSION) – API version.
orgUnitId (D2LID) – Org unit ID.
forumId (D2LID) – Forum ID.
topicId (D2LID) – Topic ID.
postId (D2LID) – Post ID.
- Status Codes:
200 OK – Action succeeded.
403 Forbidden – No permission to rate posts.
404 Not Found – Post not found.
429 Too Many Requests – API call-rate limit exceeded.
- API Versions:
1.82+ – Route first appears in LMS v20.25.1.
1.75-81 – Deprecated as of LMS v20.26.1.
1.74- – Obsolete as of LMS v20.26.1.
Input. Using this action causes the service to update the current user context’s rating for a post with a null rating value.
- GET /d2l/api/le/(version)/(orgUnitId)/discussions/forums/(forumId)/topics/(topicId)/posts/¶
Retrieve all posts in a discussion forum topic.
- Parameters:
version (D2LVERSION) – API version.
orgUnitId (D2LID) – Org unit ID.
forumId (D2LID) – Forum ID.
topicId (D2LID) – Topic ID
- Query Parameters:
pageSize (integer) – Optional. Number of topics (maximum) to return in each data page (default, maximum value is 1000).
pageNumber (integer) – Optional. Ordinal number for the data page to fetch (default value is 1).
threadsOnly (boolean) – Optional. When true, the service will only return threads (default value is false).
threadId (number:D2LID) – Optional. If present and true, the service returns only posts in this thread; otherwise, the service returns posts in multiple threads.
sort (string) – Optional. Sort by creationdate, rating, votes, upvotes, or threaded (see description).
- Oauth2 Scopes:
discussions:posts:readonly
- Status Codes:
200 OK – Action succeeded.
403 Forbidden – No permission to see posts.
404 Not Found – Topic not found.
429 Too Many Requests – API call-rate limit exceeded.
- API Versions:
1.82+ – Route first appears in LMS v20.25.1.
1.75-81 – Deprecated as of LMS v20.26.1.
1.74- – Obsolete as of LMS v20.26.1.
Input. You can control the sorting of results retrieved with this action using the sort query parameter.
You can control the sorting key field, and the direction of the sort, by using the key name in combination with a minus sign (to make the sort descending instead of ascending). Thus, to do an ascending sort by rating you use ?sort=rating; to do a descending sort by votes you use ?sort=-votes.
If you don’t provide the parameter, this action behaves as if you had provided ?sort=-creationdate (descending sort by creation date value).
Return. This action returns a JSON array of
Postdata blocks containing the properties for all the posts (including threads) in the indicated discussion forum topic that meet the provided optional filters. The data blocks returned here respect the org unit’s privacy settings with respect to the DisplayName properties (typically, the display-name gets formed from the user’s first and last names, and privacy settings govern the visibility of those items).Note
If the calling user context has permission to approve posts, then the returned block includes any unapproved posts as well as approved posts. If the calling user context has permission to see deleted posts, then the returned block includes deleted posts as well as those not deleted.
As of LMS v20.23.4 applications should use the discussions:posts:readonly scope to gain access to this action. While the discussions:posts:read scope will still provide access, use of discussions:posts:read for this action is now deprecated.
- GET /d2l/api/le/(version)/(orgUnitId)/discussions/forums/(forumId)/topics/(topicId)/posts/(postId)¶
Retrieve a particular post in a discussion forum topic.
- Parameters:
version (D2LVERSION) – API version.
orgUnitId (D2LID) – Org unit ID.
forumId (D2LID) – Forum ID.
topicId (D2LID) – Topic ID.
postId (D2LID) – Post ID.
- Oauth2 Scopes:
discussions:posts:readonly
- Status Codes:
200 OK – Action succeeded.
403 Forbidden – No permission to see posts.
404 Not Found – Post not found.
429 Too Many Requests – API call-rate limit exceeded.
- API Versions:
1.82+ – Route first appears in LMS v20.25.1.
1.75-81 – Deprecated as of LMS v20.26.1.
1.74- – Obsolete as of LMS v20.26.1.
Return. This action returns a
Postdata block containing the properties for the indicated discussion forum post. The data blocks returned here respect the org unit’s privacy settings with respect to the DisplayName properties (typically, the display-name gets formed from the user’s first and last names, and privacy settings govern the visibility of those items).Note
As of LMS v20.23.4 applications should use the discussions:posts:readonly scope to gain access to this action. While the discussions:posts:read scope will still provide access, use of discussions:posts:read for this action is now deprecated.
- GET /d2l/api/le/(version)/(orgUnitId)/discussions/forums/(forumId)/topics/(topicId)/posts/(postId)/attachments/(fileId)¶
Retrieve a specific file attachment from a discussion forum post.
- Parameters:
- Oauth2 Scopes:
discussions:posts:readonly
- Status Codes:
200 OK – Action successful.
403 Forbidden – No permission to see posts.
404 Not Found – Post not found, or no such file attachment.
429 Too Many Requests – API call-rate limit exceeded.
- API Versions:
1.95+ – Route first appears in LMS v20.26.6.
Return. This action returns a file stream containing the attachment identified by the provided file ID (you can determine the available file IDs for a post from the Attachments property of the
Postdata block).
- GET /d2l/api/le/(version)/(orgUnitId)/discussions/forums/(forumId)/topics/(topicId)/posts/(postId)/Approval¶
Retrieve the approval status for a particular post in a discussion forum topic.
- Parameters:
version (D2LVERSION) – API version.
orgUnitId (D2LID) – Org unit ID.
forumId (D2LID) – Forum ID.
topicId (D2LID) – Topic ID.
postId (D2LID) – Post ID.
- Oauth2 Scopes:
discussions:posts:readonly
- Status Codes:
200 OK – Action succeeded.
403 Forbidden – No permission to see the approval status for this post.
404 Not Found – Post not found.
429 Too Many Requests – API call-rate limit exceeded.
- API Versions:
1.82+ – Route first appears in LMS v20.25.1.
1.75-81 – Deprecated as of LMS v20.26.1.
1.74- – Obsolete as of LMS v20.26.1.
Return. This action returns a
ApprovalDataJSON data block containing the approval status for the indicated discussion forum post.
- GET /d2l/api/le/(version)/(orgUnitId)/discussions/forums/(forumId)/topics/(topicId)/posts/(postId)/Flag¶
Retrieve the flagged status for a particular post in a discussion forum topic.
- Parameters:
version (D2LVERSION) – API version.
orgUnitId (D2LID) – Org unit ID.
forumId (D2LID) – Forum ID.
topicId (D2LID) – Topic ID.
postId (D2LID) – Post ID.
- Oauth2 Scopes:
discussions:posts:readonly
- Status Codes:
200 OK – Action succeeded.
403 Forbidden – No permission to see the flag status for this post.
404 Not Found – Post not found.
429 Too Many Requests – API call-rate limit exceeded.
- API Versions:
1.82+ – Route first appears in LMS v20.25.1.
1.75-81 – Deprecated as of LMS v20.26.1.
1.74- – Obsolete as of LMS v20.26.1.
Return. This action returns a
FlagDataJSON data block containing the flagged status for the indicated discussion forum post.
- GET /d2l/api/le/(version)/(orgUnitId)/discussions/forums/(forumId)/topics/(topicId)/posts/(postId)/Rating¶
Retrieve the rating data for a particular post in a discussion forum topic.
- Parameters:
version (D2LVERSION) – API version.
orgUnitId (D2LID) – Org unit ID.
forumId (D2LID) – Forum ID.
topicId (D2LID) – Topic ID.
postId (D2LID) – Post ID.
- Oauth2 Scopes:
discussions:posts:readonly
- Status Codes:
200 OK – Action succeeded.
403 Forbidden – No permission to see rating data for this post.
404 Not Found – Post not found.
429 Too Many Requests – API call-rate limit exceeded.
- API Versions:
1.82+ – Route first appears in LMS v20.25.1.
1.75-81 – Deprecated as of LMS v20.26.1.
1.74- – Obsolete as of LMS v20.26.1.
Return. This action returns a
RatingDataJSON data block containing current rating data for the indicated discussion forum post.
- GET /d2l/api/le/(version)/(orgUnitId)/discussions/forums/(forumId)/topics/(topicId)/posts/(postId)/Rating/MyRating¶
Retrieve the current user context’s rating data for a particular post in a discussion forum topic.
- Parameters:
version (D2LVERSION) – API version.
orgUnitId (D2LID) – Org unit ID.
forumId (D2LID) – Forum ID.
topicId (D2LID) – Topic ID.
postId (D2LID) – Post ID.
- Oauth2 Scopes:
discussions:my_posts:readonly
- Status Codes:
200 OK – Action succeeded.
403 Forbidden – No permission to see rating data for this post.
404 Not Found – Post not found.
429 Too Many Requests – API call-rate limit exceeded.
- API Versions:
1.82+ – Route first appears in LMS v20.25.1.
1.75-81 – Deprecated as of LMS v20.26.1.
1.74- – Obsolete as of LMS v20.26.1.
Return. This action returns a
UserRatingDataJSON data block containing the current user’s rating data for the indicated discussion form post.
- GET /d2l/api/le/(version)/(orgUnitId)/discussions/forums/(forumId)/topics/(topicId)/posts/(postId)/ReadStatus¶
Retrieve the current read status for a particular post in a discussion forum topic.
- Parameters:
version (D2LVERSION) – API version.
orgUnitId (D2LID) – Org unit ID.
forumId (D2LID) – Forum ID.
topicId (D2LID) – Topic ID.
postId (D2LID) – Post ID.
- Oauth2 Scopes:
discussions:posts:readonly
- Status Codes:
200 OK – Action succeeded.
403 Forbidden – No permission to see read status for this post.
404 Not Found – Post not found.
429 Too Many Requests – API call-rate limit exceeded.
- API Versions:
1.82+ – Route first appears in LMS v20.25.1.
1.75-81 – Deprecated as of LMS v20.26.1.
1.74- – Obsolete as of LMS v20.26.1.
Return. This action returns a
ReadStatusDataJSON data block containing the read status for the indicated discussion forum post.
- GET /d2l/api/le/(version)/(orgUnitId)/discussions/forums/(forumId)/topics/(topicId)/posts/(postId)/Votes¶
Retrieve all the vote data for a particular post in a discussion forum topic.
- Parameters:
version (D2LVERSION) – API version.
orgUnitId (D2LID) – Org unit ID.
forumId (D2LID) – Forum ID.
topicId (D2LID) – Topic ID.
postId (D2LID) – Post ID.
- Oauth2 Scopes:
discussions:posts:readonly
- Status Codes:
200 OK – Action succeeded.
403 Forbidden – No permission to see votes for this post, or post not voteable.
404 Not Found – Post not found.
429 Too Many Requests – API call-rate limit exceeded.
- API Versions:
1.82+ – Route first appears in LMS v20.25.1.
1.75-81 – Deprecated as of LMS v20.26.1.
1.74- – Obsolete as of LMS v20.26.1.
Return. This action returns a
VotesDataJSON data block containing the vote data for the indicated discussion forum post.
- GET /d2l/api/le/(version)/(orgUnitId)/discussions/forums/(forumId)/topics/(topicId)/posts/(postId)/Votes/MyVote¶
Retrieve the current user’s vote data for a particular post in a discussion forum topic.
- Parameters:
version (D2LVERSION) – API version.
orgUnitId (D2LID) – Org unit ID.
forumId (D2LID) – Forum ID.
topicId (D2LID) – Topic ID.
postId (D2LID) – Post ID.
- Oauth2 Scopes:
discussions:my_posts:readonly
- Status Codes:
200 OK – Action succeeded.
403 Forbidden – No permission to see votes for this post, or post not voteable.
404 Not Found – Post not found.
429 Too Many Requests – API call-rate limit exceeded.
- API Versions:
1.82+ – Route first appears in LMS v20.25.1.
1.75-81 – Deprecated as of LMS v20.26.1.
1.74- – Obsolete as of LMS v20.26.1.
Return. This action returns a
UserVoteDataJSON data block containing the current user’s vote data for the indicated discussion forum post.
- POST /d2l/api/le/(version)/(orgUnitId)/discussions/forums/(forumId)/topics/(topicId)/posts/¶
Create a new post in a discussion forum topic.
- Parameters:
version (D2LVERSION) – API version.
orgUnitId (D2LID) – Org unit ID.
forumId (D2LID) – Forum ID.
topicId (D2LID) – Topic ID
- JSON Parameters:
CreatePostData (
Discussions.CreatePostData) – New post data, but usage varies (see input description).
- Oauth2 Scopes:
discussions:posts:manage
- Status Codes:
200 OK – Action succeeded.
400 Bad Request – Invalid post data provided, or attempt to post anonymously when not permitted.
403 Forbidden – No permission to create a post or thread.
404 Not Found – Parent post identified but not found, or topic not found.
429 Too Many Requests – API call-rate limit exceeded.
- API Versions:
1.82+ – Route first appears in LMS v20.25.1.
1.75-81 – Deprecated as of LMS v20.26.1.
1.74- – Obsolete as of LMS v20.26.1.
Input. You can use this action in two ways:
If you want to create a new post with no file attachments, then send a simple POST with a
CreatePostDataJSON data block for the new post’s information, as you would any other POST passing just the JSON structure to the back-end learning service.If you want to create a new post with one or more file attachments, then you must use a multipart/mixed content type body where the first part is the
CreatePostDataJSON data block for the new post’s information, and the subsequent part(s) contain the files you want to upload.
To create the new post within the thread of an existing post, use the ParentPostId property to indicate that post (if you provide null for the ParentPostID property, this action creates a new thread of posts for the discussion forum topic).
Note
You cannot use this action to create posts in group-type topics.
Return. This action returns a
PostJSON data block containing the properties for the newly created discussion forum post.Note
As of LMS v20.23.4 applications should use the discussions:posts:manage scope to gain access to this action. While the discussions:posts:read scope will still provide access, use of discussions:posts:read for this action is now deprecated.
- POST /d2l/api/le/(version)/(orgUnitId)/discussions/forums/(forumId)/topics/(topicId)/posts/(postId)/pin¶
Pin a particular post in a discussion forum topic.
- Parameters:
version (D2LVERSION) – API version.
orgUnitId (D2LID) – Org unit ID.
forumId (D2LID) – Forum ID.
topicId (D2LID) – Topic ID.
postId (D2LID) – Post ID.
- Oauth2 Scopes:
discussions:posts:manage
- Status Codes:
200 OK – Action succeeded.
403 Forbidden – No permission to pin posts.
404 Not Found – Post or Topic not found.
429 Too Many Requests – API call-rate limit exceeded.
- API Versions:
1.95+ – Route first appears in LMS v20.26.6.
Return. This action does not return a response body.
- POST /d2l/api/le/(version)/(orgUnitId)/discussions/forums/(forumId)/topics/(topicId)/posts/(postId)/unpin¶
Unpin a particular post in a discussion forum topic.
- Parameters:
version (D2LVERSION) – API version.
orgUnitId (D2LID) – Org unit ID.
forumId (D2LID) – Forum ID.
topicId (D2LID) – Topic ID.
postId (D2LID) – Post ID.
- Oauth2 Scopes:
discussions:posts:manage
- Status Codes:
200 OK – Action succeeded.
403 Forbidden – No permission to unpin posts.
404 Not Found – Post or Topic not found.
429 Too Many Requests – API call-rate limit exceeded.
- API Versions:
1.95+ – Route first appears in LMS v20.26.6.
Return. This action does not return a response body.
- PUT /d2l/api/le/(version)/(orgUnitId)/discussions/forums/(forumId)/topics/(topicId)/posts/(postId)¶
Update a particular post in a discussion forum topic.
- Parameters:
version (D2LVERSION) – API version.
orgUnitId (D2LID) – Org unit ID.
forumId (D2LID) – Forum ID.
topicId (D2LID) – Topic ID.
postId (D2LID) – Post ID.
- JSON Parameters:
UpdatePostData (
Discussions.UpdatePostData) – Multipart containing updated post’s data (see input description).
- Oauth2 Scopes:
discussions:posts:manage
- Status Codes:
200 OK – Action succeeded.
400 Bad Request – Invalid post data provided.
403 Forbidden – No permission to edit indicated post.
404 Not Found – Post not found.
429 Too Many Requests – API call-rate limit exceeded.
- API Versions:
1.82+ – Route first appears in LMS v20.25.1.
1.75-81 – Deprecated as of LMS v20.26.1.
1.74- – Obsolete as of LMS v20.26.1.
Input. The action’s body should be a multipart with a single part consisting of a
UpdatePostDataJSON data block to provide the post’s updated subject and/or message.Return. This action returns a
PostJSON data block containing the properties for the newly updated discussion forum post.Note
As of LMS v20.23.4 applications should use the discussions:posts:manage scope to gain access to this action. While the discussions:posts:read scope will still provide access, use of discussions:posts:read for this action is now deprecated.
- PUT /d2l/api/le/(version)/(orgUnitId)/discussions/forums/(forumId)/topics/(topicId)/posts/(postId)/Approval¶
Update the approval status of a particular post in a discussion forum topic.
- Parameters:
version (D2LVERSION) – API version.
orgUnitId (D2LID) – Org unit ID.
forumId (D2LID) – Forum ID.
topicId (D2LID) – Topic ID.
postId (D2LID) – Post ID.
- JSON Parameters:
ApprovalData (
Discussions.ApprovalData) – New approval status for the post.
- Oauth2 Scopes:
discussions:posts:manage
- Status Codes:
200 OK – Action succeeded.
400 Bad Request – Attempt to set approval status for a post that doesn’t require it.
403 Forbidden – No permission to approve posts.
404 Not Found – Post not found.
429 Too Many Requests – API call-rate limit exceeded.
- API Versions:
1.82+ – Route first appears in LMS v20.25.1.
1.75-81 – Deprecated as of LMS v20.26.1.
1.74- – Obsolete as of LMS v20.26.1.
Return. This action returns a
ApprovalDataJSON data block containing the new approval status for the indicated discussion forum post.
- PUT /d2l/api/le/(version)/(orgUnitId)/discussions/forums/(forumId)/topics/(topicId)/posts/(postId)/Flag¶
Update the flagged status of a particular post in a discussion forum topic.
- Parameters:
version (D2LVERSION) – API version.
orgUnitId (D2LID) – Org unit ID.
forumId (D2LID) – Forum ID.
topicId (D2LID) – Topic ID.
postId (D2LID) – Post ID.
- JSON Parameters:
FlagData (
Discussions.FlagData) – New flag status for the post.
- Oauth2 Scopes:
discussions:posts:manage
- Status Codes:
200 OK – Action succeeded.
403 Forbidden – No permission to alter post’s flagged status.
404 Not Found – Post not found.
429 Too Many Requests – API call-rate limit exceeded.
- API Versions:
1.82+ – Route first appears in LMS v20.25.1.
1.75-81 – Deprecated as of LMS v20.26.1.
1.74- – Obsolete as of LMS v20.26.1.
Return. This action returns a
FlagDataJSON data block containing the new flagged status for the indicated discussion forum post.
- PUT /d2l/api/le/(version)/(orgUnitId)/discussions/forums/(forumId)/topics/(topicId)/posts/(postId)/Rating/MyRating¶
Update the current user context’s rating for a particular post in a discussion forum topic.
- Parameters:
version (D2LVERSION) – API version.
orgUnitId (D2LID) – Org unit ID.
forumId (D2LID) – Forum ID.
topicId (D2LID) – Topic ID.
postId (D2LID) – Post ID.
- JSON Parameters:
UserRatingData (
Discussions.UserRatingData) – New user rating for the post.
- Oauth2 Scopes:
discussions:my_posts:manage
- Status Codes:
200 OK – Action succeeded.
400 Bad Request – Invalid rating data provided.
403 Forbidden – No permission to rate this post.
404 Not Found – Post not found.
429 Too Many Requests – API call-rate limit exceeded.
- API Versions:
1.82+ – Route first appears in LMS v20.25.1.
1.75-81 – Deprecated as of LMS v20.26.1.
1.74- – Obsolete as of LMS v20.26.1.
Input. If your provided new user rating contains a valid rating value, it replaces the current user’s rating for the post.
Return. This action returns a
UserRatingDataJSON data block containing the current user’s updated rating for the indicated discussion forum post.
- PUT /d2l/api/le/(version)/(orgUnitId)/discussions/forums/(forumId)/topics/(topicId)/posts/(postId)/ReadStatus¶
Update the read status of a particular post in a discussion forum topic.
- Parameters:
version (D2LVERSION) – API version.
orgUnitId (D2LID) – Org unit ID.
forumId (D2LID) – Forum ID.
topicId (D2LID) – Topic ID.
postId (D2LID) – Post ID.
- JSON Parameters:
ReadStatusData (
Discussions.ReadStatusData) – New read status for the post.
- Oauth2 Scopes:
discussions:posts:manage
- Status Codes:
200 OK – Action succeeded.
403 Forbidden – No permission to alter post’s read status.
404 Not Found – Post not found.
429 Too Many Requests – API call-rate limit exceeded.
- API Versions:
1.82+ – Route first appears in LMS v20.25.1.
1.75-81 – Deprecated as of LMS v20.26.1.
1.74- – Obsolete as of LMS v20.26.1.
Return. This action returns a
ReadStatusDataJSON data block containing the new read status for the indicated discussion forum topic.
- PUT /d2l/api/le/(version)/(orgUnitId)/discussions/forums/(forumId)/topics/(topicId)/posts/(postId)/Votes/MyVote¶
Update a discussion forum topic post’s vote data for the current user.
- Parameters:
version (D2LVERSION) – API version.
orgUnitId (D2LID) – Org unit ID.
forumId (D2LID) – Forum ID.
topicId (D2LID) – Topic ID.
postId (D2LID) – Post ID.
- JSON Parameters:
UserVoteData (
Discussions.UserVoteData) – New vote data for the post.
- Oauth2 Scopes:
discussions:my_posts:manage
- Status Codes:
200 OK – Action succeeded.
400 Bad Request – Invalid vote data provided, or down-vote provided for up-vote only post.
403 Forbidden – No permission to provide vote data for post.
404 Not Found – Post not found.
429 Too Many Requests – API call-rate limit exceeded.
- API Versions:
1.82+ – Route first appears in LMS v20.25.1.
1.75-81 – Deprecated as of LMS v20.26.1.
1.74- – Obsolete as of LMS v20.26.1.
Statistics¶
- GET /d2l/api/le/(version)/(orgUnitId)/discussions/statistics¶
Retrieve overall discussion statistics for an org unit.
- Parameters:
version (D2LVERSION) – API version.
orgUnitId (D2LID) – Org unit ID.
- Oauth2 Scopes:
discussions:statistics:readonly
- Status Codes:
200 OK – Action succeeded.
403 Forbidden – No permission to access discussions or see statistics for this org unit.
429 Too Many Requests – API call-rate limit exceeded.
- API Versions:
1.95+ – Route first appears in LMS v20.26.6.
Return. This action returns an
OrgUnitOverallStatsJSON block containing org-unit-wide totals for threads, replies, pinned threads, and unapproved posts.
- GET /d2l/api/le/(version)/(orgUnitId)/discussions/userstatistics¶
Retrieve per-user discussion statistics for an org unit.
- Parameters:
version (D2LVERSION) – API version.
orgUnitId (D2LID) – Org unit ID.
- Query Parameters:
pageSize (integer) – Optional. Number of user records to return per page (default, maximum value is 1000).
pageNumber (integer) – Optional. Ordinal number for the data page to fetch (default value is 1).
- Oauth2 Scopes:
discussions:statistics:readonly
- Status Codes:
200 OK – Action succeeded.
400 Bad Request – Invalid pagination parameters.
403 Forbidden – No permission to access discussions or see statistics for this org unit.
404 Not Found – User context cannot be determined.
429 Too Many Requests – API call-rate limit exceeded.
- API Versions:
1.95+ – Route first appears in LMS v20.26.6.
Return. This action returns a JSON array of
OrgUnitUserStatsblocks containing per-user statistics sorted by last name ascending.
- GET /d2l/api/le/(version)/(orgUnitId)/discussions/forumtopicstatistics¶
Retrieve discussion statistics for an org unit, broken down by forum and topic.
- Parameters:
version (D2LVERSION) – API version.
orgUnitId (D2LID) – Org unit ID.
- Query Parameters:
pageSize (integer) – Optional. Number of forum records to return per page (default, maximum value is 1000).
pageNumber (integer) – Optional. Ordinal number for the data page to fetch (default value is 1).
- Oauth2 Scopes:
discussions:statistics:readonly
- Status Codes:
200 OK – Action succeeded.
400 Bad Request – Invalid pagination parameters.
403 Forbidden – No permission to access discussions or see statistics for this org unit.
429 Too Many Requests – API call-rate limit exceeded.
- API Versions:
1.95+ – Route first appears in LMS v20.26.6.
Return. This action returns a JSON array of
OrgUnitForumStatsblocks, each containing nestedOrgUnitTopicStatsblocks.Note
Pagination applies to the forum list. All topics for the returned forums are included. Forums are sorted by forum sort order; topics within each forum are sorted by topic sort order ascending.
- GET /d2l/api/le/(version)/(orgUnitId)/discussions/forums/(forumId)/topics/(topicId)/statistics¶
Retrieve discussion statistics for a specific topic within a forum.
- Parameters:
version (D2LVERSION) – API version.
orgUnitId (D2LID) – Org unit ID.
forumId (D2LID) – Forum ID.
topicId (D2LID) – Topic ID.
- Oauth2 Scopes:
discussions:statistics:readonly
- Status Codes:
200 OK – Action succeeded.
403 Forbidden – No permission to access discussions or see statistics for this org unit.
404 Not Found – Topic not found, or topic does not belong to the specified forum, or topic does not belong to the specified org unit.
429 Too Many Requests – API call-rate limit exceeded.
- API Versions:
1.95+ – Route first appears in LMS v20.26.6.
Return. This action returns a
TopicStatsJSON block containing topic-level totals and rating data.
- GET /d2l/api/le/(version)/(orgUnitId)/discussions/forums/(forumId)/topics/(topicId)/userstatistics¶
Retrieve per-user discussion statistics for a specific topic within a forum.
- Parameters:
version (D2LVERSION) – API version.
orgUnitId (D2LID) – Org unit ID.
forumId (D2LID) – Forum ID.
topicId (D2LID) – Topic ID.
- Query Parameters:
pageSize (integer) – Optional. Number of user records to return per page (default, maximum value is 1000).
pageNumber (integer) – Optional. Ordinal number for the data page to fetch (default value is 1).
- Oauth2 Scopes:
discussions:statistics:readonly
- Status Codes:
200 OK – Action succeeded.
400 Bad Request – Invalid pagination parameters.
403 Forbidden – No permission to access discussions or see statistics for this org unit.
404 Not Found – Topic not found, or topic does not belong to the specified forum, or topic does not belong to the specified org unit.
429 Too Many Requests – API call-rate limit exceeded.
- API Versions:
1.95+ – Route first appears in LMS v20.26.6.
Return. This action returns a JSON array of
TopicUserStatsblocks containing per-user statistics for the indicated topic, sorted by last name ascending.
- GET /d2l/api/le/(version)/(orgUnitId)/discussions/forums/(forumId)/statistics¶
Retrieve discussion statistics for a specific forum within an org unit.
- Parameters:
version (D2LVERSION) – API version.
orgUnitId (D2LID) – Org unit ID.
forumId (D2LID) – Forum ID.
- Oauth2 Scopes:
discussions:statistics:readonly
- Status Codes:
200 OK – Action succeeded.
403 Forbidden – No permission to access discussions or see statistics for this org unit.
404 Not Found – Forum not found or does not belong to the specified org unit.
429 Too Many Requests – API call-rate limit exceeded.
- API Versions:
1.95+ – Route first appears in LMS v20.26.6.
Return. This action returns a
ForumStatsJSON block containing thread and reply counts for the specified forum and for all forums in the org unit, plus the list of topic IDs belonging to the forum.
Exemptions¶
- DELETE /d2l/api/le/(version)/(orgUnitId)/discussions/forums/(forumId)/topics/(topicId)/user/(userId)/exemption¶
Remove an existing exemption for a specific user from a discussion topic.
- Parameters:
version (D2LVERSION) – API version.
orgUnitId (D2LID) – Org unit ID.
forumId (D2LID) – Forum ID.
topicId (D2LID) – Topic ID.
userId (D2LID) – User ID.
- Oauth2 Scopes:
discussions:exemptions:delete
- Status Codes:
200 OK – Action succeeded.
403 Forbidden – No permission to manage user exemptions for this org unit.
404 Not Found – Topic not found, or the forum/org unit do not match the topic, or the target user does not exist, is not enrolled in the org unit, or cannot be seen by the calling user.
429 Too Many Requests – API call-rate limit exceeded.
- API Versions:
1.95+ – Route first appears in LMS v20.26.6.
- GET /d2l/api/le/(version)/(orgUnitId)/discussions/forums/(forumId)/topics/(topicId)/exemption¶
Retrieve the list of users currently exempted from a discussion topic.
- Parameters:
version (D2LVERSION) – API version.
orgUnitId (D2LID) – Org unit ID.
forumId (D2LID) – Forum ID.
topicId (D2LID) – Topic ID.
- Oauth2 Scopes:
discussions:exemptions:read
- Status Codes:
200 OK – Action succeeded.
403 Forbidden – No permission to manage user exemptions for this org unit.
404 Not Found – Topic not found, or the forum/org unit do not match the topic.
429 Too Many Requests – API call-rate limit exceeded.
- API Versions:
1.95+ – Route first appears in LMS v20.26.6.
Return. This action returns a JSON array of D2LID numbers representing the users currently exempted from the specified discussion topic. Returns an empty array if no users are exempted.
- POST /d2l/api/le/(version)/(orgUnitId)/discussions/forums/(forumId)/topics/(topicId)/user/(userId)/exemption¶
Exempt a specific user from a discussion topic.
- Parameters:
version (D2LVERSION) – API version.
orgUnitId (D2LID) – Org unit ID.
forumId (D2LID) – Forum ID.
topicId (D2LID) – Topic ID.
userId (D2LID) – User ID.
- Oauth2 Scopes:
discussions:exemptions:create
- Status Codes:
200 OK – Action succeeded.
403 Forbidden – No permission to manage user exemptions for this org unit.
404 Not Found – Topic not found, or the forum/org unit do not match the topic, or the target user does not exist, is not enrolled in the org unit, or cannot be seen by the calling user.
429 Too Many Requests – API call-rate limit exceeded.
- API Versions:
1.95+ – Route first appears in LMS v20.26.6.