Skip to content

Stats for multiple categories in one API call #129

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
neelabhtiwari opened this issue Dec 6, 2020 · 4 comments · Fixed by #134
Closed

Stats for multiple categories in one API call #129

neelabhtiwari opened this issue Dec 6, 2020 · 4 comments · Fixed by #134
Labels
status: help wanted requesting help from the community type: bug bug in the library

Comments

@neelabhtiwari
Copy link

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

  1. 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/Log

paste exception/log here


### Technical details:
* java-http-client version: Sendgrid 4.6.4
* java version: JDK 14

@thinkingserious
Copy link
Contributor

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

@thinkingserious thinkingserious added status: waiting for feedback waiting for feedback from the submitter type: question question directed at the library labels Jan 8, 2021
@neelabhtiwari
Copy link
Author

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

@JenniferMah
Copy link
Contributor

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.

@JenniferMah JenniferMah added status: help wanted requesting help from the community type: bug bug in the library and removed status: waiting for feedback waiting for feedback from the submitter type: question question directed at the library labels Feb 2, 2021
@neelabhtiwari
Copy link
Author

+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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
status: help wanted requesting help from the community type: bug bug in the library
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants