You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm trying to make a GET request to the API in C# using the NuGet Package. The problem is when I try to make a GET request to "categories/stats" it throws an error message saying "start_date is required and should be a YYYY-MM-DD formatted date" even though I'm writting "start_date" to the query parameter like the documentation says. Here is my code.
Btw, I solved the issue without using the NuGet Package.
var client = new RestClient("https://api.sendgrid.com/v3/categories/stats?aggregated_by=day&limit=10&categories=MyCategory&start_date=2019-06-06");
var request = new RestRequest(Method.GET);
request.AddHeader("authorization", "Bearer <<MY TOKEN>>");
request.AddParameter("undefined", "{}", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
But I'm still confused about why the first solution didn't work in this case if I've previously used the same way to make a GET request to other urlPath.
Activity
edorguez commentedon Aug 2, 2019
Btw, I solved the issue without using the NuGet Package.
But I'm still confused about why the first solution didn't work in this case if I've previously used the same way to make a GET request to other urlPath.
thinkingserious commentedon Aug 21, 2019
Hello @edorguez,
Thanks for reporting this and for providing a work around. We've added this issue to our backlog for further review.
With best regards,
Elmer
childish-sambino commentedon Jun 23, 2020
This is probably the issue in your code:
Working example here: https://github.com/sendgrid/sendgrid-csharp/blob/master/examples/categories/categories.cs#L37