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.
Hi
Trying to figure out how to create a webhook.
Is there anything within the UI to create it or does it have to be done via API?
https://canvas.instructure.com/doc/api/webhooks_subscriptions.html
In the API docs I could not see where to put the url where the webhook would be directed to.
https://canvas.instructure.com/doc/api/webhooks_subscriptions.html
If anyone has an example I would really appreciate it.
Glenn
How list the all events availables and data formats?
Hi Glenn, did you find an answer to this. I am also seeking this information.
I see you asking about this in several places today, so I'll tag you here and respond.
I was looking for a way to use the Canvas Data Services Live Events going directly to https rather than SQS. I tested something in our beta instance, but there's not much happening there and I didn't get any results (it might have been the code I was using). When that didn't work, I got lead me down the path of webhooks and a lot of confusion and despair.
However, I just managed to get it working relatively simply without using the API at all and without any fancy OAuth requirements. When you leave off the sign the payload, it comes through as plain text.
When you go to Admin > Data Services, there is a Documentation Tab that tells you how to set up a data stream. There is also an Event Format where you can see all of the event formats for Canvas or Caliper IMS. That said it was going a little crazy for me and not completely reliable (it seemed to be making 100's of requests to fetch one json string). You can also find examples of the events while you care adding a new stream.
To add a new data stream ...
You can tell what the events will look like by clicking on the event. For example, when I click on logged_in, I get an example event.
My PHP program for testing purposes? It was really quite simple (no error checking). The newline character in my fwrite() was so each entry came out on a separate line in the log file. It just made it easier to human-read.
<?php
$data = file_get_contents('php://input');
$fh = fopen('/tmp/liveevents.txt', 'a');
fwrite($fh, $data . "\n");
fclose($fh);
You could take the $data and use $events = json_decode($data, TRUE); and then act on the contents directly rather than logging to a file. I was just trying to see if it would work, and it did.
Hope this helps.
Thank you James!
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
This discussion post is outdated and has been archived. Please use the Community question forums and official documentation for the most current and accurate information.