I am trying to lookup/scan the status of URLs with the Google Safe Browsing API v4, I tried the method I found in this link How to use Google Safe Browsing (v4) with .NET, but i get a null response returned.
Here's the code:
private async void checkUrlBtn_Click(object sender, EventArgs e)
{
var service = new SafebrowsingService(new BaseClientService.Initializer
{
ApplicationName = "dotnet-client",
ApiKey = "MY_API"
});
var request = service.ThreatMatches.Find(new FindThreatMatchesRequest()
{
Client = new ClientInfo
{
ClientId = "Dotnet-client",
ClientVersion = "1.5.2"
},
ThreatInfo = new ThreatInfo()
{
ThreatTypes = new List<string> { "SOCIAL_ENGINEERING" },
PlatformTypes = new List<string> { "PLATFORM_TYPE_UNSPECIFIED" },
ThreatEntryTypes = new List<string> { "URL" },
ThreatEntries = new List<ThreatEntry>
{
new ThreatEntry
{
Url = "https://someurlIGotFromPhishtank.com"
}
}
}
});
var response = await request.ExecuteAsync();
string json = JsonConvert.SerializeObject(response);
string jsonFormatted = JToken.Parse(json).ToString(Formatting.Indented);
Console.WriteLine(jsonFormatted);
}
My Response:
{
"matches": null,
"ETag": null
}
At this point I feel I am doing something very wrong and I need HELP!!!