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!
I am trying to build an application that sends an http request to an external server and processes the returned JSON within canvas whenever a student submits an assignment.
I found a lot of resources on accessing the Instructure API from external calls, but I need to do the opposite -- here canvas is the client and the external endpoint is the server.
Could you link me to some resources on how I can implement this?
Sounds like this would be a case for using your Canvas Theme JS overrides file. You would need to set up a proper event handler to detect when the assignment was submitted and then execute a XHR request against your server's endpoint.
If you want an external server to do something when an assignment in submitted in Canvas you can subscribe the Live Events that Canvas publishes: https://community.canvaslms.com/t5/Admin-Guide/How-do-I-subscribe-to-Live-Events-using-Canvas-Data-S...
You should be able to configure and endpoint that Canvas will send a message to when someone submits an assignment, in the JSON you will get details of the assignment and who is submitting, the documentation for the JSON message that is sent for student assignment submissions is:
https://canvas.instructure.com/doc/api/file.data_service_canvas_submission.html
If you then need to get more data you can use the Canvas APIs to lookup further information.
You may need to reach out to your CSM to get the live events support enabled. The feature is called "Data Services".
Then, in the docs, you'll find an event called "submission_created": https://collegiseducation.instructure.com/doc/api/file.data_service_canvas_submission.html#submissio...
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