Exporting Course information using API
I have had success exporting "grades" information using the API but so far have not been able to export course information.
I have looked through the API documentation I can find and put together a GET string similar to what I use for grades that I thought should pull course information for a single course but it returns a 404 error.
Ideally I would like to export information for all courses rather than one course at a time.
Is this possible and would someone be able to point me in the right direction to achieve this ?
My current attempt is in this format with the portion for the district abbreviation replaced with x's.
GET https://xxxxxtest.brightspace.om/d2l/api/lp/1.67/courses/31714
Thank you.
Best Answer
-
Hi @Dale.G.287,
Thank you for your response. The Unknown error (HTTP status 403) error occurs when the user making the API call is not enrolled into the course in question.
Please try making the call below again while ensuring the user being used for the API call has access to the course or you can change to another course.
https://xxxxxtest.brightspace.om/d2l/api/lp/1.43/courses/31714
I hope this helps. Please let me know if you have any other questions.
Answers
-
Hi @Dale.G.287,
Thank you for the question. It looks like you are using this API endpoint.
Please note that API Version 1.67 is not available for this endpoint. Could you please try with 1.43?
GET https://xxxxxtest.brightspace.om/d2l/api/lp/1.43/courses/31714You can get a list of child units for a provided org unit with this endpoint-
GET /d2l/api/lp/1.43/orgstructure/(orgUnitId)/children/To get a list of Course Offerings only, you can set a filter with Query Parameter - ouTypeId. Here's an example-
GET /d2l/api/lp/1.43/orgstructure/(orgUnitId)/children/?ouTypeId=3
I hope this helps. Please let me know if you have any questions. -
Using the 1.43 endpoint changed the error from 404 to 403 Forbidden, so some progress.
-
After working with one of the technical people and gaining a little better understanding of how the APIs work I have been able to pull semester and course information. Unfortunately I am now having difficulty pulling the grades information that I was able to get a month or two ago. I'm pretty sure I have the Auth 2.0 information configured the same as it was at that time but I'm getting the 403 Forbidden error with this GET statement.
GET https://xxxxxtest.brightspace.com/d2l/api/le/1.67/10111/grades/final/values/
Any thoughts on what I may be missing or would this be a permission somewhere in Brightspace. I am supposed to be a Super Administrator and I have been able to get all semester information and any of the courses information I have attempted.
-
@Dale.G.287 Hi Dale, try changing 1.67 to 1.75. The documentation says that 1.67-74 – Deprecated as of LMS v20.25.1 so it was a very recent change.
-
Thank you for your reply Jennifer. I neglected to mention I had try 1.75 previously and have just tried it again with the same result - "403 Forbidden".