-
Notifications
You must be signed in to change notification settings - Fork 723
Cannot submit multiple categories to Categories Statistics endpoint #186
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
Comments
Solved with sendgrid/python-http-client#11 |
While multiple categories can be passed for Category Statistics, passing any more than 10 categories in the params leads to a 400 Bad Request error. Code to Reproduce
Is there a way this limit can be lifted? Thanks! |
Hi @ninadamondikar, This is a limitation of the API. I will pass along your feedback to the product team. Could you please describe your use case? With Best Regards, Elmer |
Hi - My use case is that I am looking to export a dataset with all the stats for every single email category in my SendGrid account (which at this point is over a 100). This dataset will be used for internal reporting and analytics on email performance by being imported into a business intelligence software. Currently, I have a workaround for this: making multiple calls offsetting each call by 10 starting from 0 and then combining the output. However as the number of categories keeps increasing lifting the cap on number of categories will help streamline the code. Thanks! |
Hello @ninadamondikar, Do you mind opening up a new issue specifically for this request? I'd like to try and get better visibility to increase its priority. Thanks! With Best Regards, Elmer |
Issue Summary
When using the client to get statistics for categories, it's not possible to submit multiple categories.
Steps to Reproduce
The above code makes a GET to this URL. Sendgrid returns a
404
for this request.When the correct behaviour is a GET with both
category1
andcategory1
as values tocategories
. Sendgrid returns the expected response.This seems to be a bug, as the Sendgrid docs clearly state sending multiple categories is supported, and there doesn't seem to be a way to do that with this client.
I believe the issue is actually here, in the python-http-client lib.
urlencode
should be passed a second parameter, (doseq
), which will correctly format multiple values for parameters. (urlencode docs)Technical details:
The text was updated successfully, but these errors were encountered: