PagerDuty/pdpyras

Didn't find a way to `pass statuses[] more than once`

thanch2n opened this issue · 3 comments

Looks we can't use same key with different values in dict and pass to params.
But on server side it supports To query multiple statuses, pass statuses[] more than once,
https://developer.pagerduty.com/api-reference/9d0b4b12e36f9-list-incidents.

        params = {
            'statuses[]': 'acknowledged',
            'statuses[]': 'triggered',
            'statuses[]': 'resolved',
        }
        for incident in session.iter_all('incidents', params):
            yield incident

Note, pdpyras.APISession is a wrapper of requests.Session.

Per Passing parameters in URLs, The way to pass multi-valued parameters when using a dictionary is to have one key pointing to a list i.e. 'statuses[]': ['acknowledged', 'triggered', 'resolved']

Added to list of things to document with the release of v5.0

#97 will take care of this