> ## Documentation Index
> Fetch the complete documentation index at: https://docs.coreflux.org/llms.txt
> Use this file to discover all available pages before exploring further.

# Sentry

> Client-mode REST API connector for a curated Sentry slice: list project issues, get an issue, and resolve it

Technical Preview

# Sentry

Client-mode REST API connector for a curated Sentry slice: list project issues, get an issue, and resolve it.

* Hub category: **Monitoring**.
* Base: `https://sentry.io`

## Template reference

Generated from the shipped broker template `sentry` (`-routeCode SENTRY`). It lists every event the template defines.

### Auth

Auth headers used by the template: `Authorization: Bearer {value.json.api_token}`.

### Template parameters

| Placeholder | Type | Description | Required |
| - | - | - | - |
| `RouteName` | string | Name of the Sentry connector | no |
| `BaseUrl` | string | Sentry base URL without trailing slash (e.g. [https://sentry.io](https://sentry.io)) | yes |

`BASE_ADDRESS` default: `https://sentry.io`.

### Events

| Event | Method | Endpoint | Request topic | Response topic | Payload fields |
| - | - | - | - | - | - |
| `Listissues` | GET | `/api/0/projects/{value.json.organization}/{value.json.project}/issues/` | `monitoring/sentry/issues/list` | `monitoring/sentry/issues/list/response` | `api_token`, `organization`, `project` |
| `Getissue` | GET | `/api/0/issues/{value.json.issue_id}/` | `monitoring/sentry/issues/get` | `monitoring/sentry/issues/get/response` | `api_token`, `issue_id` |
| `Resolveissue` | PUT | `/api/0/issues/{value.json.issue_id}/` | `monitoring/sentry/issues/resolve` | `monitoring/sentry/issues/resolve/response` | `api_token`, `body`, `issue_id` |

### Deploy

Get the template card (JSON with `template` and `metadata`) from the broker, then deploy the connector:

```bash theme={"theme":"css-variables","languages":{"custom":["/languages/lot.json"]}}
mosquitto_pub -t '$SYS/Coreflux/Command' -m "-routeCode SENTRY"
```

The deployable connector from the REST API app, with `BASE_ADDRESS` already filled in:

```lot theme={"theme":"css-variables","languages":{"custom":["/languages/lot.json"]}}
DEFINE ROUTE SentryRestApi WITH TYPE REST_API
    ADD REST_API_CONFIG
        WITH BASE_ADDRESS "https://sentry.io"
        WITH ENABLE_CLIENT "true"
        WITH USE_SSL "true"
        WITH REQUEST_TIMEOUT '60'
        WITH DEFAULT_CONTENT_TYPE "application/json"
    ADD EVENT Listissues
        WITH SOURCE_TOPIC "monitoring/sentry/issues/list"
        WITH DESTINATION_TOPIC "monitoring/sentry/issues/list/response"
        WITH METHOD "GET"
        WITH ENDPOINT "/api/0/projects/{value.json.organization}/{value.json.project}/issues/"
        WITH HEADERS
            ADD "Accept" "application/json"
            ADD "Authorization" "Bearer {value.json.api_token}"
    ADD EVENT Getissue
        WITH SOURCE_TOPIC "monitoring/sentry/issues/get"
        WITH DESTINATION_TOPIC "monitoring/sentry/issues/get/response"
        WITH METHOD "GET"
        WITH ENDPOINT "/api/0/issues/{value.json.issue_id}/"
        WITH HEADERS
            ADD "Accept" "application/json"
            ADD "Authorization" "Bearer {value.json.api_token}"
    ADD EVENT Resolveissue
        WITH SOURCE_TOPIC "monitoring/sentry/issues/resolve"
        WITH DESTINATION_TOPIC "monitoring/sentry/issues/resolve/response"
        WITH METHOD "PUT"
        WITH ENDPOINT "/api/0/issues/{value.json.issue_id}/"
        WITH HEADERS
            ADD "Accept" "application/json"
            ADD "Content-Type" "application/json"
            ADD "Authorization" "Bearer {value.json.api_token}"
        WITH BODY "{value.json.body}"
```

Deploy it with `-addRoute` (do not include `ADD METADATA`).

### Usage example

Call `Listissues` by publishing a JSON payload to its request topic, and read the reply on the response topic:

```bash theme={"theme":"css-variables","languages":{"custom":["/languages/lot.json"]}}
mosquitto_sub -t 'monitoring/sentry/issues/list/response' &
mosquitto_pub -t 'monitoring/sentry/issues/list' -m '{"api_token": "<api_token>", "organization": "<organization>", "project": "<project>"}'
```


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.