Internet Engineer
Internet Engineer

Reputation: 2534

SendGrid suppression/bounces provides no results []

When trying to retrieve suppression or bounces using SendGrid API 3, I get no results.

I am only interested in downloading all global bounces or unsubscribes.

Console program with Sendgrid result

string queryParamsBounce = @"{
                               'end_time': 1, 
                               'start_time': 1
                             }";
var responseBounce = await client.RequestAsync(method: BaseClient.Method.GET, urlPath: "suppression/bounces", queryParams: queryParamsBounce);
Console.WriteLine(responseBounce.StatusCode);
Console.WriteLine(responseBounce.Body.ReadAsStringAsync().Result);
Console.WriteLine(responseBounce.Headers.ToString());

Upvotes: 0

Views: 892

Answers (1)

eliiii
eliiii

Reputation: 11

Just delete the queryParams from the api request as below:

var response = await client.RequestAsync(method: SendGridClient.Method.GET, urlPath: "suppression/blocks");

Or change the endtime parameter to a time in future. e.g. 'end_time':2212920280

Upvotes: 1

Related Questions