## Gemeinsame Parametertabelle für alle Methoden (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
```

| PARAMETERNAME     | WERT                                          |  PFLICHT  | STANDARDWERT  |
|:------------------|:----------------------------------------------|:---------:|:-------------:|
| application_id    | [Anwendungs-ID](https://www.bulkgate.com/de/dokumentation/api-verwaltung-und-tokens/api-verwaltung/)  |  **Ja**   |       -       | 
| application_token | [Anwendungstoken](https://www.bulkgate.com/de/dokumentation/api-verwaltung-und-tokens/api-tokens/)        |  **Ja**   |       -       |
| phone_number      | Telefonnummer des Kontakts                    |  **Ja**   |       -       |

## Einwilligung anzeigen

### API-URL (show)
URL zum Senden von HTTP-Anfragen:
```url
https://portal.bulkgate.com/api/1.0/address-book/agreement/show
```

### Beispiel einer vollständigen Anfrage (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"
}
```

### Mögliche Antworten auf diesen Befehl (show)

**Bei Erfolg:**
```json
{
    "data": {
        "phone_number": "+420777777777",
        "agreement": "2023-03-30T13:29:15+02:00"
    }
}
```

**Bei einem Fehler:**
```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
}
```

## Einwilligung hinzufügen
> [!NOTE]
> Ist die Telefonnummer nicht im Adressbuch vorhanden, wird sie automatisch hinzugefügt.

### API-URL (add)
URL zum Senden von HTTP-Anfragen:
```url
https://portal.bulkgate.com/api/1.0/address-book/agreement/add
```

### Beispiel einer vollständigen Anfrage (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"
}
```

### Mögliche Antworten auf diesen Befehl (add)

**Bei Erfolg:**
```json
{
    "data": {
        "phone_number": "+420777777777",
        "agreement": "2023-03-30T12:59:26+02:00"
    }
}
```

**Bei einem Fehler:**

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

## Einwilligung entfernen

### API-URL (remove)
URL zum Senden von HTTP-Anfragen:
```url
https://portal.bulkgate.com/api/1.0/address-book/agreement/remove
```

### Beispiel einer vollständigen Anfrage (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"
}
```

### Mögliche Antworten auf diesen Befehl (remove)

**Bei Erfolg:**
```json
{
    "data": {
        "phone_number": "+420777777777",
        "agreement": "null"
    }
}
```

**Bei einem Fehler:**
```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
}
```
