sendgrid / sendgrid-java

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

When using the client to get statistics for categories, it's not possible to submit multiple categories. #702

Closed lucasfen closed 2 years ago

lucasfen commented 3 years ago

Steps to Reproduce SendGrid sg = new SendGrid(sendGridApiKey); Request request = new Request(); request.setMethod(Method.GET); request.setEndpoint("categories/stats"); request.addQueryParam("aggregated_by", "day"); request.addQueryParam("start_date", "2021-09-06");; request.addQueryParam("categories", "category1&category2"); Response response = sg.api(request); The above code makes a GET to this URL. Sendgrid returns a 404 for this request.

When utilizing the code it reproduces this url:

https://api.sendgrid.com/v3/categories/stats?start_date=2021-09-01&categories=Promotions%26Survey&limit=500&aggregated_by=day

When it should be producing this url:

https://api.sendgrid.com/v3/categories/stats?start_date=2021-09-01&categories=Promotions&categories=Survey&limit=500&aggregated_by=day

And I found the same problem mentioned in below issue had been fixed in python client https://github.com/sendgrid/sendgrid-python/issues/186.

shwetha-manvinkurke commented 3 years ago

This issue has been added to our internal backlog to be prioritized. Pull requests and +1s on the issue summary will help it move up the backlog.