-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathRequest_API_Key
30 lines (29 loc) · 987 Bytes
/
Request_API_Key
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
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()