# Aan de slag met de Instatus API

Source: https://instatus.com/help/nl/api

Alle endpoints staan onder de URL `https://api.instatus.com`. Ze volgen doorgaans de REST-architectuur.

Alle verzoeken moeten als JSON worden verstuurd met de header `Content-Type: application/json`.

Responses van de Instatus API, foutmeldingen inbegrepen, zijn eveneens als JSON gecodeerd.

## Authenticatie

Verzoeken aan de Instatus API moeten een API-token meesturen via de Authorization-header:

Je API-sleutel vind je bij Gebruikersinstellingen → [Ontwikkelaarsinstellingen](https://dashboard.instatus.com/developer)

```bash
Authorization: Bearer <API_KEY>
```

## Je Page ID ophalen
Je Page ID vind je in het dashboard via deze stappen:
1. Ga naar je dashboard.
2. Klik met rechts op je project linksboven om het menu te openen.
3. Klik op **Copy Project ID**; je pagina-ID wordt naar je klembord gekopieerd.

![Page ID](https://instatus.com/help/page_id.png)

## Fouten

Alle API-endpoints geven bij fouten een code en een bericht terug in de foutrespons.

```json
{
  "error": {
    "code": "forbidden",
    "message": "Not authorized"
  }
}
```

## Statuswaarden

Mogelijke paginastatussen. Dit is de gedetailleerde `status` die de huidige API (v2 en later) teruggeeft. Het oudere endpoint `summary.json` en [webhook-notificaties](https://instatus.com/help/nl/webhooks) gebruiken een beknopte vorm met alleen `UP`, `HASISSUES` en `UNDERMAINTENANCE`.

- `UP`
- `HASISSUES`
- `ALLUNDERMAINTENANCE`
- `ALLDEGRADEDPERFORMANCE`
- `ALLPARTIALOUTAGE`
- `ALLMINOROUTAGE`
- `ALLMAJOROUTAGE`
- `SOMEUNDERMAINTENANCE`
- `SOMEDEGRADEDPERFORMANCE`
- `SOMEPARTIALOUTAGE`
- `SOMEMINOROUTAGE`
- `SOMEMAJOROUTAGE`
- `ONEUNDERMAINTENANCE`
- `ONEDEGRADEDPERFORMANCE`
- `ONEPARTIALOUTAGE`
- `ONEMINOROUTAGE`
- `ONEMAJOROUTAGE`

Mogelijke componentstatussen:

- `OPERATIONAL`
- `UNDERMAINTENANCE`
- `DEGRADEDPERFORMANCE`
- `PARTIALOUTAGE`
- `MAJOROUTAGE`

Mogelijke incidentstatussen:

- `INVESTIGATING`
- `IDENTIFIED`
- `MONITORING`
- `RESOLVED`

Mogelijke onderhoudsstatussen:

- `NOTSTARTEDYET`
- `INPROGRESS`
- `COMPLETED`

## Spring naar de endpoints:

- [Statuspagina’s](https://instatus.com/help/nl/api/status-pages)
- [Workspaces](https://instatus.com/help/nl/api/workspaces)
- [Componenten](https://instatus.com/help/nl/api/components)
- [Incidenten](https://instatus.com/help/nl/api/incidents)
- [Incidentupdates](https://instatus.com/help/nl/api/incident-updates)
- [Onderhoud](https://instatus.com/help/nl/api/maintenances)
- [Onderhoudsupdates](https://instatus.com/help/nl/api/maintenance-updates)
- [Sjablonen](https://instatus.com/help/nl/api/templates)
- [Algemene meldingen](https://instatus.com/help/nl/api/generic-notices)
- [Storingen](https://instatus.com/help/nl/api/outages)
- [Teamleden](https://instatus.com/help/nl/api/teammates)
- [Abonnees](https://instatus.com/help/nl/api/subscribers)
- [Metrics](https://instatus.com/help/nl/api/metrics)
- [Gebruikersprofiel](https://instatus.com/help/nl/api/user-profile)
- [Openbare data](https://instatus.com/help/nl/api/public-data)
- [Privépagina’s](https://instatus.com/help/nl/api/private-pages)
- [Doelgroepen](https://instatus.com/help/nl/api/audience-groups)
- [Monitors](https://instatus.com/help/nl/api/monitors)
- [Monitoringintegraties](https://instatus.com/help/nl/api/monitoring-integrations)
- [Routeringsregels](https://instatus.com/help/nl/api/routing-rules)
- [Escalatiebeleid](https://instatus.com/help/nl/api/escalation-policies)
- [Oproeproosters](https://instatus.com/help/nl/api/on-call-schedules)
