Skip to content

fix: Allow for multiple values for a parameter #11

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

Merged
merged 1 commit into from
Oct 30, 2017

Conversation

xiaoboa
Copy link
Contributor

@xiaoboa xiaoboa commented Aug 1, 2017

This PR is trying to fix issue: sendgrid/sendgrid-ruby#145

Issue Summary

When using the client to get statistics for categories, it's not possible to retrieve stats for all categories

Steps to Reproduce

fun_stats = sg.client.categories.stats.get(query_params: {
    'start_date' => "2017-07-31",
    'categories' => 'category1&category2'
})

The above code makes a GET to this URL. Sendgrid returns stats for category1 only

https://api.sendgrid.com/v3/categories/stats?categories=category1&category2&start_date=2017-07-30

When the correct behaviour is a GET with both category1 and category2 as values to categories. Sendgrid returns the expected response.

https://api.sendgrid.com/v3/categories/stats?categories=category1&categories=category2&start_date=2017-07-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.

Technical details:

sendgrid-ruby Version: 5.0.0
Ruby Version: 2.3.4

@thinkingserious thinkingserious added the status: code review request requesting a community code review or review from Twilio label Aug 1, 2017
@SendGridDX
Copy link

SendGridDX commented Aug 1, 2017

CLA assistant check
All committers have signed the CLA.

@thinkingserious thinkingserious added difficulty: medium fix is medium in difficulty hacktoberfest labels Sep 30, 2017
@thinkingserious thinkingserious merged commit 9e21b3b into sendgrid:master Oct 30, 2017
@thinkingserious
Copy link
Contributor

Hello @xiaoboa,

Thanks again for the PR!

We want to show our appreciation by sending you some swag. Could you please fill out this form so we can send it to you? Thanks!

Team SendGrid DX

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
difficulty: medium fix is medium in difficulty status: code review request requesting a community code review or review from Twilio
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants