## API-URL
URL for sending av HTTP-forespørsler:
```url
https://portal.bulkgate.com/api/1.0/otp/verify
```

> [!NOTE]
> Hvis forespørselen ikke når frem, gjentar du den på [reserveserveren](https://www.bulkgate.com/no/dokumentasjon/api-administrasjon/api-reserveserver/) `backup1.bulkgate.com`.

## Støttede HTTP-metoder

- `POST` - `application/json`

```http
POST /api/1.0/otp/verify HTTP/1.1
Host: portal.bulkgate.com
Content-Type: application/json
```

## Parametertabell

| PARAMETERNAVN     | VERDI | OBLIGATORISK | STANDARDVERDI |
|:------------------|:------|:----------|:--------------|
| application_id    | [Applikasjons-ID](https://www.bulkgate.com/no/dokumentasjon/api-administrasjon/administrasjon-av-api/) | **Ja** | - | 
| application_token | [Applikasjonstoken](https://www.bulkgate.com/no/dokumentasjon/api-administrasjon/api-token/) | **Ja** | - |
| id                | ID-en du fikk da engangspassordet ble sendt | **Ja** | - |
| code              | Koden som skal bekreftes | **Ja** | - |


## Eksempel på forespørsel

```http-json
POST /api/1.0/otp/verify HTTP/1.1
Host: portal.bulkgate.com
Content-Type: application/json

{
    "application_id": 451,
    "application_token": "NKN02TWE6NfBkfl-your-secret-token-Wf05GaqLIWLW4aBj",
    "id": "otp-id",
    "code": "0000"
}
```

## Svar

**Ved suksess:**
```json
{
    "data": {
        "id": "otp-id",
        "verified": true
    }
}
```

**Ved ugyldig kode:**
```json
{
    "data": {
        "id": "otp-id",
        "verified": false
    }
}
```

**Ved feil:**
```json
{
    "type": "unknown_identity",
    "code": 400,
    "error": "Unknown identity",
    "detail": null
}
```

```json
{
    "type": "invalid_input_parameters",
    "code": 400,
    "error": "Invalid input parameters",
    "detail": null
}
```

Der:

- **type** og **error** (beskrivelse av feilen) finner du i [tabellen over feiltyper](https://www.bulkgate.com/no/dokumentasjon/api-administrasjon/api-feiltyper/)
- **code** er HTTP-feilkoden
- **detail** er tilleggsinformasjon om feilen
