## API URL
URL used to send HTTP requests:
```url
https://portal.bulkgate.com/api/1.0/otp/resend
```

> [!NOTE]
> If the request does not reach its destination, repeat it on the [backup server](https://www.bulkgate.com/en/docs/api-administration-tokens/api-backup-server/) `backup1.bulkgate.com`.

## Supported HTTP methods

- `POST` - `application/json`

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

> [!IMPORTANT]
> Two resends of the same request must be **60 seconds** apart. An earlier attempt returns `the_quota_of_one_additional_resend_per_minute_has_been_exceeded`. The number of resends is further capped by `trials_available_resend` from the [SEND](https://www.bulkgate.com/en/docs/otp-api/one-time-password-send/) request.

## Parameters table

| PARAMETER NAME | VALUE | MANDATORY | DEFAULT VALUE |
|:--- |:--- |:--- |:--- |
|application_id| [Application ID](https://www.bulkgate.com/en/docs/api-administration-tokens/api-administration/) |**Yes**|-| 
|application_token| [Application token](https://www.bulkgate.com/en/docs/api-administration-tokens/api-tokens/)	|**Yes**|-|
|id| Id received by sending one time password |**Yes**|-|


## Example request

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

## Response

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

**In case of error:**
```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
}
```

Where:

- **type** and **error** (description of the error) can be found in the [error types table](https://www.bulkgate.com/en/docs/api-administration-tokens/api-error-types/)
- **code** represents http error
- **detail** is an additional info about the error
