Last active
March 12, 2016 20:14
-
-
Save Synvox/142cee8ea5f5f1ad0761 to your computer and use it in GitHub Desktop.
Brightspace discussion board notes
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // get d2l_referrer (required for making posts) | |
| var list = window.top.D2L.OR.__g1 | |
| for(var i in list) | |
| if (list[i].indexOf('d2l_referrer') !== -1) | |
| return JSON.parse(list[i]).P[1] | |
| // Unofficial API (This one doesn't give 403s to students) | |
| $.post('https://byui.brightspace.com/d2l/le/(ORG_UNIT)/discussions/posts/(TOPIC)/FinishReply',{ | |
| postData$subject:"Subject", | |
| postData$message$html:'Html', | |
| postData$message$id:"newPostBottom_(TOPIC)$postData$message", | |
| postData$message$htmlOrgUnitId:(ORG_UNIT), | |
| d2l_referrer:(D2L_REFERRER) | |
| },function(e){ | |
| console.log(e); | |
| }) | |
| // Get Posts | |
| $.getJSON('/d2l/api/le/1.5/(ORG_UNIT)/discussions/forums/(FORUM)/topics/(TOPIC)/posts/',{ | |
| },function(e){ | |
| console.log(e) | |
| }) | |
| // Get Post | |
| $.getJSON('/d2l/api/le/1.5/(ORG_UNIT)/discussions/forums/(FORUM)/topics/(TOPIC)/posts/(POST)',{ | |
| },function(e){ | |
| console.log(e) | |
| }) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment