Stats for multiple categories in one API call
Closed this issue · 4 comments
Issue Summary
Sendgrid API v3 Reference for categories/stats endpoints states that API call can be made to get stats for upto 10 categories.
However, it does not provide any reference for how to make that API call. I checked the code for addQueryParam here
https://github.com/sendgrid/java-http-client/blob/main/src/main/java/com/sendgrid/Request.java
which takes categories as only key-value pair. How are we supposed to pass "upto 10 categories"?
Steps to Reproduce
- Use categories/stats endpoint to get stats for 10 categories in the same API call.
Code Snippet
# paste code here
request.setMethod(Method.GET);
request.setEndpoint("categories/stats");
request.addQueryParam("categories", "qa2"); //how to pass multiple categories here
### Exception/Logpaste exception/log here
### Technical details:
* java-http-client version: Sendgrid 4.6.4
* java version: JDK 14
Hello @neelabhtiwari,
You would call the addQueryParam function multiple times, like so.
Please let me know if that solves your issue. Thank you!
With best regards,
Elmer
Hi Elmer,
Apologies for late reply but I had actually tried this already. This doesn't work. The addQueryParam will just replace the previously set category with the latter one. Please see the following example -
request.addQueryParam("categories", "dev");
request.addQueryParam("categories", "stage");
request.addQueryParam("categories", "prod");
Expected would be to get category stats for all three categories but it would just replace the category value with the latest one i.e. prod.
Thanks & Regards,
Neelabh
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.
+1
Would you like us to raise a priority support request on this feature from our enterprise account? Let me know if that helps in moving this up the backlog.