Skip to content

Commit

Permalink
add webhook secret
Browse files Browse the repository at this point in the history
change webhook targetURL to URI object
  • Loading branch information
bbender committed Sep 27, 2017
1 parent 7c3383d commit ca7b5a3
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -126,13 +126,14 @@ class Example {
webhook.setResource("messages");
webhook.setEvent("created");
webhook.setFilter("mentionedPeople=me");
webhook.setTargetUrl("http://www.example.com/webhook");
webhook.setSecret("SOMESECRET");
webhook.setTargetUrl(URI.create("http://www.example.com/webhook"));
webhook=spark.webhooks().post(webhook);


// List webhooks
spark.webhooks().iterate().forEachRemaining(webhook -> {
System.out.println(webhook.getId() + ": " + webhook.getName() + " (" + webhook.getTargetUrl() + ")");
spark.webhooks().iterate().forEachRemaining(hook -> {
System.out.println(hook.getId() + ": " + hook.getName() + " (" + hook.getTargetUrl() + ")" + " Secret - " + hook.getSecret());
});


Expand Down

0 comments on commit ca7b5a3

Please sign in to comment.