@@ -57,18 +57,17 @@ org_slug = '___ORG_SLUG___' # Write your organization slug here
57
57
58
58
# Create the check-in
59
59
json_data = {' status' : ' in_progress' }
60
- response = requests.post(f ' https://sentry.io/api/0/organizations/ { org_slug} /monitors/ { monitor_id} /checkins/ ' , headers = headers, json = json_data)
61
- checkin_id = response.json()[' id' ]
60
+ requests.post(f ' https://sentry.io/api/0/organizations/ { org_slug} /monitors/ { monitor_id} /checkins/ ' , headers = headers, json = json_data)
62
61
63
62
# Execute your scheduled task code here...
64
63
65
64
# Update the check-in status (required) and duration (optional)
66
65
json_data = {' status' : ' ok' , ' duration' : 3000 }
67
- response = requests.put(f ' https://sentry.io/api/0/organizations/ { org_slug} /monitors/ { monitor_id} /checkins/ { checkin_id } / ' , headers = headers, json = json_data)
66
+ requests.put(f ' https://sentry.io/api/0/organizations/ { org_slug} /monitors/ { monitor_id} /checkins/latest / ' , headers = headers, json = json_data)
68
67
```
69
68
70
69
``` bash {tabTitle: curl}
71
- # Create the check-in and save the returned CHECKIN_ID
70
+ # Create the check-in
72
71
$ curl -X POST \
73
72
' https://sentry.io/api/0/organizations/___ORG_SLUG___/monitors/{MONITOR_ID}/checkins/' \
74
73
--header ' Authorization: DSN ___PUBLIC_DSN___' \
@@ -79,7 +78,7 @@ $ curl -X POST \
79
78
80
79
# Update the check-in status (required) and duration (optional)
81
80
$ curl -X PUT \
82
- ' https://sentry.io/api/0/organizations/___ORG_SLUG___/monitors/{MONITOR_ID}/checkins/{CHECKIN_ID} /' \
81
+ ' https://sentry.io/api/0/organizations/___ORG_SLUG___/monitors/{MONITOR_ID}/checkins/latest /' \
83
82
--header ' Authorization: DSN ___PUBLIC_DSN___' \
84
83
--header ' Content-Type: application/json' \
85
84
--data-raw ' {"status": "ok", "duration": 3000}'
0 commit comments