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.
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 }
- 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 }
- 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).
- 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.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> }
- 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.
- 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> } }
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.67+ – Route first appears in LMS v20.23.1.
1.61-1.66 – Deprecated as of LMS v20.24.1.
1.60- – Obsolete as of LMS v20.24.1.
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.
- 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.67+ – Route first appears in LMS v20.23.1.
1.61-1.66 – Deprecated as of LMS v20.24.1.
1.60- – Obsolete as of LMS v20.24.1.
Return. This action returns a JSON array of
Forum
data 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.67+ – Route first appears in LMS v20.23.1.
1.61-1.66 – Deprecated as of LMS v20.24.1.
1.60- – Obsolete as of LMS v20.24.1.
Return. This action returns a
Forum
data 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.
- 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.67+ – Route first appears in LMS v20.23.1.
1.61-1.66 – Deprecated as of LMS v20.24.1.
1.60- – Obsolete as of LMS v20.24.1.
Return. This action returns a
Forum
JSON 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.
- 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.67+ – Route first appears in LMS v20.23.1.
1.61-1.66 – Deprecated as of LMS v20.24.1.
1.60- – Obsolete as of LMS v20.24.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
Forum
JSON 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.
- 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.67+ – Route first appears in LMS v20.23.1.
1.61-1.66 – Deprecated as of LMS v20.24.1.
1.60- – Obsolete as of LMS v20.24.1.
Return. This action returns a
object list page
containing the resultingUserAccess
blocks for the segment following your bookmark parameter (or the first segment if that parameter is empty or missing).
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.67+ – Route first appears in LMS v20.23.1.
1.61-1.66 – Deprecated as of LMS v20.24.1.
1.60- – Obsolete as of LMS v20.24.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.
- 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.67+ – Route first appears in LMS v20.23.1.
1.61-1.66 – Deprecated as of LMS v20.24.1.
1.60- – Obsolete as of LMS v20.24.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.67+ – Route first appears in LMS v20.23.1.
1.61-1.66 – Deprecated as of LMS v20.24.1.
1.60- – Obsolete as of LMS v20.24.1.
Return. This action returns a
object list page
containing the resultingUserAccess
blocks 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.67+ – Route first appears in LMS v20.23.1.
1.61-1.66 – Deprecated as of LMS v20.24.1.
1.60- – Obsolete as of LMS v20.24.1.
Return. This action returns a JSON array of
Topic
data 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.67+ – Route first appears in LMS v20.23.1.
1.61-1.66 – Deprecated as of LMS v20.24.1.
1.60- – Obsolete as of LMS v20.24.1.
Return. This action returns a
Topic
JSON 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
- 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.67+ – Route first appears in LMS v20.23.1.
1.61-1.66 – Deprecated as of LMS v20.24.1.
1.60- – Obsolete as of LMS v20.24.1.
Return. This action returns a JSON array of
GroupRestriction
data 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.67+ – Route first appears in LMS v20.23.1.
1.61-1.66 – Deprecated as of LMS v20.24.1.
1.60- – Obsolete as of LMS v20.24.1.
Return. This action returns a
Topic
JSON 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.
- 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.67+ – Route first appears in LMS v20.23.1.
1.61-1.66 – Deprecated as of LMS v20.24.1.
1.60- – Obsolete as of LMS v20.24.1.
Return. This action returns a
Topic
JSON 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.
- 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.67+ – Route first appears in LMS v20.23.1.
1.61-1.66 – Deprecated as of LMS v20.24.1.
1.60- – Obsolete as of LMS v20.24.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.67+ – Route first appears in LMS v20.23.1.
1.61-1.66 – Deprecated as of LMS v20.24.1.
1.60- – Obsolete as of LMS v20.24.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.67+ – Route first appears in LMS v20.23.1.
1.61-1.66 – Deprecated as of LMS v20.24.1.
1.60- – Obsolete as of LMS v20.24.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.67+ – Route first appears in LMS v20.23.1.
1.61-1.66 – Deprecated as of LMS v20.24.1.
1.60- – Obsolete as of LMS v20.24.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
Post
data 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.
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)¶
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.67+ – Route first appears in LMS v20.23.1.
1.61-1.66 – Deprecated as of LMS v20.24.1.
1.60- – Obsolete as of LMS v20.24.1.
Return. This action returns a
Post
data 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)/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.
- 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.67+ – Route first appears in LMS v20.23.1.
1.61-1.66 – Deprecated as of LMS v20.24.1.
1.60- – Obsolete as of LMS v20.24.1.
Return. This action returns a
ApprovalData
JSON 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.
- 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.67+ – Route first appears in LMS v20.23.1.
1.61-1.66 – Deprecated as of LMS v20.24.1.
1.60- – Obsolete as of LMS v20.24.1.
Return. This action returns a
FlagData
JSON 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.
- 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.67+ – Route first appears in LMS v20.23.1.
1.61-1.66 – Deprecated as of LMS v20.24.1.
1.60- – Obsolete as of LMS v20.24.1.
Return. This action returns a
RatingData
JSON 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.
- 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.67+ – Route first appears in LMS v20.23.1.
1.61-1.66 – Deprecated as of LMS v20.24.1.
1.60- – Obsolete as of LMS v20.24.1.
Return. This action returns a
UserRatingData
JSON 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.
- 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.67+ – Route first appears in LMS v20.23.1.
1.61-1.66 – Deprecated as of LMS v20.24.1.
1.60- – Obsolete as of LMS v20.24.1.
Return. This action returns a
ReadStatusData
JSON 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.
- 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.67+ – Route first appears in LMS v20.23.1.
1.61-1.66 – Deprecated as of LMS v20.24.1.
1.60- – Obsolete as of LMS v20.24.1.
Return. This action returns a
VotesData
JSON 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.
- 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.67+ – Route first appears in LMS v20.23.1.
1.61-1.66 – Deprecated as of LMS v20.24.1.
1.60- – Obsolete as of LMS v20.24.1.
Return. This action returns a
UserVoteData
JSON 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:readonly
- 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.67+ – Route first appears in LMS v20.23.1.
1.61-1.66 – Deprecated as of LMS v20.24.1.
1.60- – Obsolete as of LMS v20.24.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
CreatePostData
JSON 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 an RFC2388-style Multipart/Mixed body where the first part is the
CreatePostData
JSON 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
Post
JSON 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: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.
- 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.67+ – Route first appears in LMS v20.23.1.
1.61-1.66 – Deprecated as of LMS v20.24.1.
1.60- – Obsolete as of LMS v20.24.1.
Input. The action’s body should be a multipart with a single part consisting of a
UpdatePostData
JSON data block to provide the post’s updated subject and/or message.Return. This action returns a
Post
JSON 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.
- 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.67+ – Route first appears in LMS v20.23.1.
1.61-1.66 – Deprecated as of LMS v20.24.1.
1.60- – Obsolete as of LMS v20.24.1.
Return. This action returns a
ApprovalData
JSON 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.
- 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.67+ – Route first appears in LMS v20.23.1.
1.61-1.66 – Deprecated as of LMS v20.24.1.
1.60- – Obsolete as of LMS v20.24.1.
Return. This action returns a
FlagData
JSON 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.
- 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.67+ – Route first appears in LMS v20.23.1.
1.61-1.66 – Deprecated as of LMS v20.24.1.
1.60- – Obsolete as of LMS v20.24.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
UserRatingData
JSON 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.
- 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.67+ – Route first appears in LMS v20.23.1.
1.61-1.66 – Deprecated as of LMS v20.24.1.
1.60- – Obsolete as of LMS v20.24.1.
Return. This action returns a
ReadStatusData
JSON 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.
- 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.67+ – Route first appears in LMS v20.23.1.
1.61-1.66 – Deprecated as of LMS v20.24.1.
1.60- – Obsolete as of LMS v20.24.1.