Skip to content

Instantly share code, notes, and snippets.

@pmatthews05
Created January 8, 2020 10:11
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/27c9663b737657190305f88756a528cc to your computer and use it in GitHub Desktop.
Save pmatthews05/27c9663b737657190305f88756a528cc to your computer and use it in GitHub Desktop.
AuditWebhook Getting the Content URI
string token = await AcquireTokenForApplication();
var uri = auditContentQueue.ContentUri;
do
{
uri = uri.Contains("?") ? $"{uri}&PublisherIdentifier={auditContentQueue.TenantID}" : $"{uri}?PublisherIdentifier={auditContentQueue.TenantID}";
log.LogInformation($"URL:{uri}");
var results = await RestAPI.GetRestDataAsync(uri, token);
var array = JArray.Parse(results.RestResponse);
foreach(var logEntry in array)
{
log.LogInformation(logEntry.ToString());
}
uri = results.WebHeaderCollections.Get("NextPageUri");
} while (uri != null);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment