I was able to create a web based application for Gmail API to get all the unread emails from specific email address in Javas Script. But I need to use stand alone application. I chose VB using VS 2017. I was able to connect and Authenticated and get label but can't get to the part to search for unread (and from) using filter parameters.
scope.Add(GmailService.Scope.MailGoogleCom)
Dim credential =GoogleWebAuthorizationBroker.AuthorizeAsync(Secrets, scope, "Client ", CancellationToken.None).Result()
initializer.HttpClientInitializer = credential
initializer.ApplicationName = "Gmail API Quickstart"
Dim service = New GmailService(initializer)
Dim userId As String = "email@gmail.com"
Dim request As UsersResource.LabelsResource.ListRequest = service.Users.Labels.List("me")
' List labels.
Dim labels As IList(Of Label) = request.Execute().Labels
Console.WriteLine("Labels:")
If labels IsNot Nothing AndAlso labels.Count > 0 Then
For Each labelItem In labels
MsgBox(labelItem.Name)
Next
Else
Console.WriteLine("No labels found.")
End If
I appropriate any help. Thanks