Skip to content

Instantly share code, notes, and snippets.

@andrei-markeev
Created October 29, 2017 10:43
Show Gist options
  • Save andrei-markeev/52905c332f8cdf2963ca3290a0b8b2b3 to your computer and use it in GitHub Desktop.
Save andrei-markeev/52905c332f8cdf2963ca3290a0b8b2b3 to your computer and use it in GitHub Desktop.
Minimum example for working with SP webhooks from Azure Functions
module.exports = function (azureContext, req) {
if (req.query.validationtoken) {
azureContext.log('Validation token received: ' + req.query.validationtoken);
azureContext.res = {
body: req.query.validationtoken,
isRaw: true
};
azureContext.done();
return;
}
azureContext.log("Request body:", req.body);
azureContext.done();
});
@andrei-markeev
Copy link
Author

For adding SP web hooks, use SP Chrome Editor: https://github.com/tavikukko/Chrome-SP-Editor
image

@s-KaiNet
Copy link

s-KaiNet commented Nov 2, 2017

You can also use sphooks if you prefer cli tools.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment