## Tabla de parámetros común a todos los métodos (show, add, remove)

```url
https://portal.bulkgate.com/api/1.0/address-book/agreement/show
https://portal.bulkgate.com/api/1.0/address-book/agreement/add
https://portal.bulkgate.com/api/1.0/address-book/agreement/remove
```

| NOMBRE DEL PARÁMETRO | VALOR | OBLIGATORIO | VALOR PREDETERMINADO |
|:------------------|:----------------------------------------------|:---------:|:-------------:|
| application_id | [Application ID](https://www.bulkgate.com/es/documentacion/administracion-de-la-api/administracion-api/) | **Sí** | - |
| application_token | [Application token](https://www.bulkgate.com/es/documentacion/administracion-de-la-api/tokens-de-api/) | **Sí** | - |
| phone_number | Número de teléfono del contacto | **Sí** | - |

## Mostrar el consentimiento

### URL de la API (show)
URL utilizada para enviar las solicitudes HTTP:
```url
https://portal.bulkgate.com/api/1.0/address-book/agreement/show
```

### Ejemplo de solicitud completa (show)

```http-json
POST /api/1.0/address-book/agreement/show HTTP/1.1
Host: portal.bulkgate.com
Content-Type: application/json

{
	"application_id": 451,
	"application_token": "NKN02TWE6NfBkfl-your-secret-token-Wf05GaqLIWLW4aBj",
	"phone_number": "+420777777777"
}
```

### Posibles respuestas a este comando (show)

**En caso de éxito:**
```json
{
    "data": {
        "phone_number": "+420777777777",
        "agreement": "2023-03-30T13:29:15+02:00"
    }
}
```

**En caso de error:**
```json
{
    "type": "number_not_found",
    "code": 400,
    "error": "Number not found",
    "detail": null
}
```

```json
{
    "type": "invalid_phone_mobile",
    "code": 400,
    "error": "Invalid phone mobile",
    "detail": null
}
```

## Añadir el consentimiento
> [!NOTE]
> Si el número de teléfono no existe en la agenda de contactos, se añadirá automáticamente. 

### URL de la API (add)
URL utilizada para enviar las solicitudes HTTP:
```url
https://portal.bulkgate.com/api/1.0/address-book/agreement/add
```

### Ejemplo de solicitud completa (add)

```http-json
POST /api/1.0/address-book/agreement/add HTTP/1.1
Host: portal.bulkgate.com
Content-Type: application/json

{
	"application_id": 451,
	"application_token": "NKN02TWE6NfBkfl-your-secret-token-Wf05GaqLIWLW4aBj",
	"phone_number": "+420777777777"
}
```

### Posibles respuestas a este comando (add)

**En caso de éxito:**
```json
{
    "data": {
        "phone_number": "+420777777777",
        "agreement": "2023-03-30T12:59:26+02:00"
    }
}
```

**En caso de error:**

```json
{
    "type": "invalid_phone_mobile",
    "code": 400,
    "error": "Invalid phone mobile",
    "detail": null
}
```

## Eliminar el consentimiento

### URL de la API (remove)
URL utilizada para enviar las solicitudes HTTP:
```url
https://portal.bulkgate.com/api/1.0/address-book/agreement/remove
```

### Ejemplo de solicitud completa (remove)

```http-json
POST /api/1.0/address-book/agreement/remove HTTP/1.1
Host: portal.bulkgate.com
Content-Type: application/json

{
	"application_id": 451,
	"application_token": "NKN02TWE6NfBkfl-your-secret-token-Wf05GaqLIWLW4aBj",
	"phone_number": "+420777777777"
}
```

### Posibles respuestas a este comando (remove)

**En caso de éxito:**
```json
{
    "data": {
        "phone_number": "+420777777777",
        "agreement": "null"
    }
}
```

**En caso de error:**
```json
{
    "type": "number_not_found",
    "code": 400,
    "error": "Number not found",
    "detail": null
}
```

```json
{
    "type": "invalid_phone_mobile",
    "code": 400,
    "error": "Invalid phone mobile",
    "detail": null
}
```
