Created
January 8, 2020 10:11
-
-
Save pmatthews05/27c9663b737657190305f88756a528cc to your computer and use it in GitHub Desktop.
AuditWebhook Getting the Content URI
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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