Skip to content

ref(crons): Update URLs for hybrid cloud #6286

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Feb 10, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 9 additions & 4 deletions src/docs/product/crons/getting-started.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -53,23 +53,24 @@ import requests

headers = {'Authorization': 'DSN ___PUBLIC_DSN___'}
monitor_id = '' # Write your monitor_id here
org_slug = '___ORG_SLUG___' # Write your organization slug here

# Create the check-in
json_data = {'status': 'in_progress'}
response = requests.post(f'https://sentry.io/api/0/monitors/{monitor_id}/checkins/', headers=headers, json=json_data)
response = requests.post(f'https://sentry.io/api/0/organizations/{org_slug}/monitors/{monitor_id}/checkins/', headers=headers, json=json_data)
checkin_id = response.json()['id']

# Execute your scheduled task code here...

# Update the check-in status (required) and duration (optional)
json_data = {'status': 'ok', 'duration': 3000}
response = requests.put(f'https://sentry.io/api/0/monitors/{monitor_id}/checkins/{checkin_id}/', headers=headers, json=json_data)
response = requests.put(f'https://sentry.io/api/0/organizations/{org_slug}/monitors/{monitor_id}/checkins/{checkin_id}/', headers=headers, json=json_data)
```

```bash {tabTitle: curl}
# Create the check-in and save the returned CHECKIN_ID
$ curl -X POST \
'https://sentry.io/api/0/monitors/{MONITOR_ID}/checkins/' \
'https://sentry.io/api/0/organizations/___ORG_SLUG___/monitors/{MONITOR_ID}/checkins/' \
--header 'Authorization: DSN ___PUBLIC_DSN___' \
--header 'Content-Type: application/json' \
--data-raw '{"status": "in_progress"}'
Expand All @@ -78,14 +79,18 @@ $ curl -X POST \

# Update the check-in status (required) and duration (optional)
$ curl -X PUT \
'https://sentry.io/api/0/monitors/{MONITOR_ID}/checkins/{CHECKIN_ID}/' \
'https://sentry.io/api/0/organizations/___ORG_SLUG___/monitors/{MONITOR_ID}/checkins/{CHECKIN_ID}/' \
--header 'Authorization: DSN ___PUBLIC_DSN___' \
--header 'Content-Type: application/json' \
--data-raw '{"status": "ok", "duration": 3000}'
```

### Request Parameters

`org_slug`:

: **Required.** Your organization's slug.

`monitor_id`:

: **Required.** Your monitor ID can be found on the monitor details page.
Expand Down