Skip to content

Instantly share code, notes, and snippets.

@pmatthews05
Created January 8, 2020 09:44
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 pmatthews05/b4bb42d881f674358e52790bb9704736 to your computer and use it in GitHub Desktop.
Save pmatthews05/b4bb42d881f674358e52790bb9704736 to your computer and use it in GitHub Desktop.
Audit O365 Webhook Trigger
string stringvalue = await req.Content.ReadAsStringAsync();
log.LogInformation($"Req.Content {stringvalue}");
try
{
log.LogInformation("Getting validation code");
dynamic data = await req.Content.ReadAsAsync<object>();
string validationToken = data.validationCode.ToString();
log.LogInformation($"Validation Token: {validationToken} received");
HttpResponseMessage response = req.CreateResponse(HttpStatusCode.OK);
response.Content = new StringContent(validationToken);
return response;
}
catch (Exception)
{
log.LogInformation("No ValidationCode, therefore process WebHook as content");
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment