sendgrid / sendgrid-java

The Official Twilio SendGrid Led, Community Driven Java API Library
https://sendgrid.com
MIT License
486 stars 408 forks source link

Sendgrid java client not returning filtered results based on "to_email" query param #771

Open schoolingtimes opened 1 month ago

schoolingtimes commented 1 month ago

I need to fetch Email Activity using this Java client library. But in this particular case when I need to fetch email activity for "to_email" query param, it is not returning me the filtered results. Instead it is returning me results which are not filtered based on the "to_email" value. I have tried by adding extra params for time range query, etc. but no luck. Same query when I try by calling directly the API (e.g. using curl or Postman) I get correct filtered results. I am using the Jar file provided by Sendgrid in my Java 8 based project.

sg = new SendGrid(sendgridApiAccessKey)
request = new Request()
request.setMethod(Method.GET)
request.setEndpoint("messages")
request.addQueryParam("limit", "10")
request.addQueryParam("to_email", "myemail@example.com")
response = sg.api(request)