Skip to content

Instantly share code, notes, and snippets.

@ypcode
Created September 16, 2017 15:40
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ypcode/375203333c57b43dc2e868793e5e09c0 to your computer and use it in GitHub Desktop.
Save ypcode/375203333c57b43dc2e868793e5e09c0 to your computer and use it in GitHub Desktop.
import pnp from "pnp";
pnp.sp.web.lists.getByTitle("testwebhook")
.subscriptions
.add("https://your-functions.azurewebsites.net/api/sample-webhook", "2017-12-01T00:00:00+00:00")
.then(r => console.log("Webhook added"))
.catch(r => console.log(r));
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment