diff --git a/Sift/Request/ScoreRequest.cs b/Sift/Request/ScoreRequest.cs index 0bbee7b3..71d6091d 100644 --- a/Sift/Request/ScoreRequest.cs +++ b/Sift/Request/ScoreRequest.cs @@ -10,6 +10,7 @@ public class ScoreRequest : SiftRequest public string UserId { get; set; } public List AbuseTypes { get; set; } = new List(); + public bool IncludeScorePercentile { get; set; } public override HttpRequestMessage Request { get @@ -31,6 +32,11 @@ protected override Uri Url url = url.AddQuery("abuse_types", string.Join(",", AbuseTypes)); } + if (IncludeScorePercentile) + { + url = url.AddQuery("fields", "SCORE_PERCENTILES"); + } + return url; } } diff --git a/Test/Test.cs b/Test/Test.cs index 695b46d7..9d4c78f7 100644 --- a/Test/Test.cs +++ b/Test/Test.cs @@ -2590,14 +2590,13 @@ public void TestGetScoreRequest() { UserId = "123", ApiKey = "345", - AbuseTypes = new List() { "payment_abuse", "promotion_abuse" } + AbuseTypes = new List() { "payment_abuse", "promotion_abuse" }, + IncludeScorePercentile = true }; - var url = scoreRequest.Request.RequestUri!.ToString(); - - Assert.Equal("https://api.sift.com/v205/users/123/score?api_key=345&abuse_types=payment_abuse,promotion_abuse", + Assert.Equal("https://api.sift.com/v205/users/123/score?api_key=345&abuse_types=payment_abuse,promotion_abuse&fields=SCORE_PERCENTILES", Uri.UnescapeDataString(scoreRequest.Request.RequestUri!.ToString())); - } + } } }