@@ -53,23 +53,24 @@ import requests
53
53
54
54
headers = {' Authorization' : ' DSN ___PUBLIC_DSN___' }
55
55
monitor_id = ' ' # Write your monitor_id here
56
+ org_slug = ' ___ORG_SLUG___' # Write your organization slug here
56
57
57
58
# Create the check-in
58
59
json_data = {' status' : ' in_progress' }
59
- response = requests.post(f ' https://sentry.io/api/0/monitors/ { monitor_id} /checkins/ ' , headers = headers, json = json_data)
60
+ response = requests.post(f ' https://sentry.io/api/0/organizations/ { org_slug } / monitors/{ monitor_id} /checkins/ ' , headers = headers, json = json_data)
60
61
checkin_id = response.json()[' id' ]
61
62
62
63
# Execute your scheduled task code here...
63
64
64
65
# Update the check-in status (required) and duration (optional)
65
66
json_data = {' status' : ' ok' , ' duration' : 3000 }
66
- response = requests.put(f ' https://sentry.io/api/0/monitors/ { monitor_id} /checkins/ { checkin_id} / ' , headers = headers, json = json_data)
67
+ response = requests.put(f ' https://sentry.io/api/0/organizations/ { org_slug } / monitors/{ monitor_id} /checkins/ { checkin_id} / ' , headers = headers, json = json_data)
67
68
```
68
69
69
70
``` bash {tabTitle: curl}
70
71
# Create the check-in and save the returned CHECKIN_ID
71
72
$ curl -X POST \
72
- ' https://sentry.io/api/0/monitors/{MONITOR_ID}/checkins/' \
73
+ ' https://sentry.io/api/0/organizations/___ORG_SLUG___/ monitors/{MONITOR_ID}/checkins/' \
73
74
--header ' Authorization: DSN ___PUBLIC_DSN___' \
74
75
--header ' Content-Type: application/json' \
75
76
--data-raw ' {"status": "in_progress"}'
@@ -78,14 +79,18 @@ $ curl -X POST \
78
79
79
80
# Update the check-in status (required) and duration (optional)
80
81
$ curl -X PUT \
81
- ' https://sentry.io/api/0/monitors/{MONITOR_ID}/checkins/{CHECKIN_ID}/' \
82
+ ' https://sentry.io/api/0/organizations/___ORG_SLUG___/ monitors/{MONITOR_ID}/checkins/{CHECKIN_ID}/' \
82
83
--header ' Authorization: DSN ___PUBLIC_DSN___' \
83
84
--header ' Content-Type: application/json' \
84
85
--data-raw ' {"status": "ok", "duration": 3000}'
85
86
```
86
87
87
88
### Request Parameters
88
89
90
+ ` org_slug ` :
91
+
92
+ : ** Required.** Your organization's slug.
93
+
89
94
` monitor_id ` :
90
95
91
96
: ** Required.** Your monitor ID can be found on the monitor details page.
0 commit comments