GRAPHQL returns incorrect course ID
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-12-2023
03:34 PM
Hi
I am writing some python to automate a few processes in Canvas via API calls.
Using the following query:
query CoursesByTerm ($term:ID!) {
term(id: $term) {
id
name
coursesConnection {
nodes {
_id
name
}
}
}
}
I get a list of courses in the term I require, however, some (about 1 in 4) of the courses return an incorrect course ID:
for example
"_id": "19783",
"name": "Year 7 Science (2023)"
The correct ID is actually 19784. There is no 19783 course.
I get the same results from the Canvas GRAPHIQL page, postman and python. If I use the /API/V1 I get the correct course ID.
Disclaimer I am very new to working with API's and Python.
Any help or insights would be greatly appreciated
Thanks