- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Accessing external server from within canvas
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?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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...
