//native
/**
* Retrieve a spike protection notification action
* Returns a serialized Spike Protection Notification Action object.
Notification Actions notify a set of members when an action has been triggered through a notification service such as Slack or Sentry.
For example, organization owners and managers can receive an email when a spike occurs.
*/
export async function main(auth: RT.Sentry, action_id: string) {
const url = new URL(
`https://${auth.region}.sentry.io/api/0/organizations/${auth.organizationSlug}/notifications/actions/${action_id}/`
)
const response = await fetch(url, {
method: 'GET',
headers: {
Authorization: 'Bearer ' + auth.token
},
body: undefined
})
if (!response.ok) {
const text = await response.text()
throw new Error(`${response.status} ${text}`)
}
return await response.json()
}
Submitted by hugo697 235 days ago