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

> [!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/resend HTTP/1.1
Host: portal.bulkgate.com
Content-Type: application/json
```

> [!IMPORTANT]
> To nye utsendinger av den samme forespørselen må ha minst **60 sekunder** mellom seg. Et tidligere forsøk returnerer `the_quota_of_one_additional_resend_per_minute_has_been_exceeded`. Antallet nye utsendinger er i tillegg begrenset av `trials_available_resend` fra [SEND](https://www.bulkgate.com/no/dokumentasjon/otp-api/send-engangspassord/)-forespørselen.

## 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**|-|


## Eksempel på forespørsel

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

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

## Svar

**Ved suksess:**
```json
{
    "data": {
        "id": "otp-65cca8b4b6a6a2.24308291",
        "message": {
          "status": "accepted",
          "message_id": "cascade-xjyjzh7thor3",
          "part_id": [
            "cascade-xjyjzh7thor3"  
          ],
          "number": "420777777777",
          "channel": "whatsapp"
        }
    }
}
```

**Ved feil:**
```json
{
    "type": "invalid_id_provided",
    "code": 400,
    "error": "Invalid id provided",
    "detail": null
}
```

```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
