Your Community is getting an upgrade!
Read about our partnership with Higher Logic and how we will build the next generation of the Instructure Community.
Found this content helpful? Log in or sign up to leave a like!
Hello,
I am working to make a sync script to pull Canvas Todos out from the API and return them.
If I log into Canvas and view my "To Do" section, there are several assignments, announcements, quizzes, etc listed.
If I call the assignments API (/api/v1/courses/:course_id/assignments/), they are all returned.
However, calling the "todo" API (/api/v1/courses/:course_id/todo/) returns NO results (just a blank JSON [])
Is there a required parameter or something I have to send to request from the Todo API?
Does the API not return the same thing as what is displayed in the WebUI?
TIA
Solved! Go to Solution.
The todo and todo_item_count endpoints both work for me.
One scenario consistent with what you're seeing is that the API token you're using is for some user other than the one you're logged into Canvas as.
Try "GET /users/self" to verify that you are using the correct token.
The /api/v1/users/self/todo also returns blank/no results.
In addition, calling "/api/v1/users/self/todo_item_count' returns the following:
The todo and todo_item_count endpoints both work for me.
One scenario consistent with what you're seeing is that the API token you're using is for some user other than the one you're logged into Canvas as.
Try "GET /users/self" to verify that you are using the correct token.
It looks like there must be something that had to finish synching, as when I polled that API endpoint today, it returned results.
Next question: It looks like when I dismiss a Todo from the WebUI (click the "X" on it), it disappears there, but is still returned through the webUI. Is that expected?
Or am I just dealing with another delay in API sync to webUI?
I know that some things are cached, but I do not know if the To Do list is one of those. I queried my To Do list through the API and got 4 items, which matched what was in my To Do list Canvas. Then I hit the X to delete on through the Web UI and within 2 seconds queried the API again. This time it returned 3 items. This is what is expected when something isn't cached because the API and the web interface pull from the same source -- and in many cases, the web interface uses the API to get the data.
Are you running your own instance of Canvas or are you hosted by Instructure? I'm using an Instructure-hosted Canvas instance, so I cannot speak to self-hosted instances and what is needed to make it responsive without a significant delay.
Hmm, gotcha. I didn't see that, I continued to get the same thing via API for several hours. However, about 24 hours later, it was updated.
I'll keep testing, this seems to be limited to the todo API - the assignments doesn't have that issue.
I believe instance is cloud hosted by Instructure, not self-hosted.
To interact with Panda Bot, our automated chatbot, you need to sign up or log in:
Sign InTo interact with Panda Bot, our automated chatbot, you need to sign up or log in:
Sign In