-
Notifications
You must be signed in to change notification settings - Fork 726
Closed
Labels
status: help wantedrequesting help from the communityrequesting help from the communitytype: bugbug in the librarybug in the librarytype: non-library issueAPI issue not solvable via the SDKAPI issue not solvable via the SDK
Description
Issue Summary
When using the client to get statistics for categories, it's not possible to submit multiple categories.
Steps to Reproduce
fun_stats = sg.client.categories.stats.get(query_params={
'start_date': "2016-06-30",
'categories': ['category1', 'category2'],
})
The above code makes a GET to this URL. Sendgrid returns a 404
for this request.
https://api.sendgrid.com/v3/categories/stats?categories=[u'category1', category2']&start_date=2016-06-30
When the correct behaviour is a GET with both category1
and category1
as values to categories
. Sendgrid returns the expected response.
https://api.sendgrid.com/v3/categories/stats?categories=category1&categories=category2&start_date=2016-06-30
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:
- sendgrid-python Version: 3.0.0
- Python Version: 2.7
Metadata
Metadata
Assignees
Labels
status: help wantedrequesting help from the communityrequesting help from the communitytype: bugbug in the librarybug in the librarytype: non-library issueAPI issue not solvable via the SDKAPI issue not solvable via the SDK