From 1bfb765b926c66a947ebb6ce6e5bc644e6421e37 Mon Sep 17 00:00:00 2001 From: Damian Myerscough Date: Fri, 26 Aug 2016 23:44:40 -0700 Subject: [PATCH] Fix param pass --- REST_API_v2/Incidents/list_incidents.py | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-) diff --git a/REST_API_v2/Incidents/list_incidents.py b/REST_API_v2/Incidents/list_incidents.py index f2795f0..e6129da 100755 --- a/REST_API_v2/Incidents/list_incidents.py +++ b/REST_API_v2/Incidents/list_incidents.py @@ -26,7 +26,6 @@ # SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. import requests -import json # Update to match your API key API_KEY = '3c3gRvzx7uGfMYEnWKvF' @@ -55,17 +54,17 @@ def list_incidents(): 'since': SINCE, 'until': UNTIL, 'date_range': DATE_RANGE, - 'statuses': STATUSES, + 'statuses[]': STATUSES, 'incident_key': INCIDENT_KEY, - 'service_ids': SERVICE_IDS, - 'team_ids': TEAM_IDS, - 'user_ids': USER_IDS, - 'urgencies': URGENCIES, + 'service_ids[]': SERVICE_IDS, + 'team_ids[]': TEAM_IDS, + 'user_ids[]': USER_IDS, + 'urgencies[]': URGENCIES, 'time_zone': TIME_ZONE, - 'sort_by': SORT_BY, - 'include': INCLUDE + 'sort_by[]': SORT_BY, + 'include[]': INCLUDE } - r = requests.get(url, headers=headers, params=json.dumps(payload)) + r = requests.get(url, headers=headers, params=payload) print 'Status Code: ' + str(r.status_code) print r.json()