I've created an external tool that we would like to link to from the Help menu. While I can easily add the link to the tool, the problem is that it (of course) does not receive any user data from Canvas, which is necessary for the tool to work. I was looking at External Tools - Canvas LMS REST API Documentation and found that I can get the tool to work correctly in a new tab when I use a sessionless launch url. The quandary in which I now find myself is this: How can I create a link to a tool (or custom page) that will make the API call to get the sessionless launch url, then redirect the user to that url? Everything I can think of so far will not work:
- I can't create a new route in my tool that will handle this because that apparently cannot communicate with Canvas. I have tried this to see what happens (expecting failure) and the tab in which that link opens simply clocks (failed as expected).
- I can't link directly to the API call, of course, because that has no capacity for digesting the response and redirecting the user.
- I was thinking about possibly adding custom JS at the root account level to make the API call and digest the response, but I can't see any way I could link to that from the Help menu. (I also cannot find where/how I would add custom JS to the root account.)
- A button could invoke the JS required as described in #3, but a button can't be added to the Help menu.
Does anyone have other ideas or suggestions, please? Thank you.