Skip to content

Stats for multiple categories in one API call #129

Closed

Description

@neelabhtiwari

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

Activity

  1. thinkingserious commented on Jan 8, 2021

    @thinkingserious
    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

  2. added
    status: waiting for feedback
    type: question
    on Jan 8, 2021
  3. neelabhtiwari commented on Feb 2, 2021

    @neelabhtiwari
    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

  4. JenniferMah commented on Feb 2, 2021

    @JenniferMah
    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.

  5. added
    status: help wanted
    type: bug
    and removed
    status: waiting for feedback
    type: question
    on Feb 2, 2021
  6. neelabhtiwari commented on Feb 3, 2021

    @neelabhtiwari
    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

Metadata

Metadata

Assignees

No one assigned

    Labels

    status: help wantedtype: bug

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions