## API-URL
URL, an die HTTP-Anfragen gesendet werden:
```url
https://portal.bulkgate.com/api/1.0/address-book/edit
```

> [!NOTE]
> Erreicht die Anfrage ihr Ziel nicht, wiederholen Sie sie auf dem [Backup-Server](https://www.bulkgate.com/de/dokumentation/api-verwaltung-und-tokens/backup-server/) `backup1.bulkgate.com`.

## Unterstützte HTTP-Methoden

- `POST` - `application/json`

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

## Parametertabelle

| 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, der bearbeitet werden soll. | **Ja** | - |
| data | Kontaktdaten | **Ja** | [Datenobjekt](#datenobjekt) |
| category | Das Adressbuch, mit dem gearbeitet wird. Standardmäßig das Hauptadressbuch des Kontos. | Nein | `main` |

> [!NOTE]
> Ein weggelassenes Feld bleibt unverändert – das Schema setzt dafür `-do-not-modify-` ein. Um ein Feld zu leeren, senden Sie einen leeren String.

## Datenobjekt

| PARAMETERNAME | WERT | PFLICHT | STANDARDWERT |
|:---------------|:---------------------------------------------------------------------------------------------------------------------------------|:----------|:--------------|
| type | Kontakttyp (person/company) | **Nein** | - |
| phone_mobile | Haupttelefonnummer | **Nein** | - |
| title_before | Titel vor dem Namen | **Nein** | - |
| first_name | Vorname | **Nein** | - |
| last_name | Nachname | **Nein** | - |
| title_after | Titel nach dem Namen | **Nein** | - |
| gender | male / female / transgender / agender / non_binary / unknown | **Nein** | unknown |
| company_name | Name Ihres Unternehmens | **Nein** | - |
| email | E-Mail | **Nein** | - |
| url | URL | **Nein** | - |
| street1 | Adresse – 1. Zeile | **Nein** | - |
| street2 | Adresse – 2. Zeile | **Nein** | - |
| city | Ort | **Nein** | - |
| zip | Postleitzahl | **Nein** | - |
| state | Bundesland / Region | **Nein** | - |
| country | [Ländercode im Format ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2#Officially_assigned_code_elements). | **Nein** | `null` |
| company_number | Handelsregisternummer | **Nein** | - |
| company_vat | USt-IdNr. | **Nein** | - |
| note | Notiz | **Nein** | - |
| custom_field_0 | Benutzerdefiniertes Feld | **Nein** | - |
| custom_field_1 | Benutzerdefiniertes Feld | **Nein** | - |
| custom_field_2 | Benutzerdefiniertes Feld | **Nein** | - |
| custom_field_3 | Benutzerdefiniertes Feld | **Nein** | - |
| custom_field_4 | Benutzerdefiniertes Feld | **Nein** | - |
| custom_field_5 | Benutzerdefiniertes Feld | **Nein** | - |
| custom_field_6 | Benutzerdefiniertes Feld | **Nein** | - |
| custom_field_7 | Benutzerdefiniertes Feld | **Nein** | - |
| custom_field_8 | Benutzerdefiniertes Feld | **Nein** | - |
| custom_field_9 | Benutzerdefiniertes Feld | **Nein** | - |

## Beispielanfrage

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

{
	"application_id": 451,
	"application_token": "NKN02TWE6NfBkfl-your-secret-token-Wf05GaqLIWLW4aBj",
	"phone_number": "123456789",
	"data": {
		"first_name": "Morgan",
		"last_name": "Yu",
		"phone_mobile": "123456789",
		"street1": "Crew's quarters",
		"street2": "Executive suite",
		"country": "Talos 1",
		"email": "morganyu@talos.com"
	}
}
```


## Antwort

**Bei Erfolg:**
```json
{
    "data": {
        "message": "contact_has_been_edited"
    }
}
```


**Bei einem Fehler:**
```json
{
    "type": "number_not_found",
    "code": 400,
    "error": "Number not found",
    "detail": null
}
```

```json
{
    "type": "invalid_phone_number",
    "code": 400,
    "error": "Invalid phone number",
    "detail": null
}
```

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

Dabei gilt:

- **type** und **error** (Beschreibung des Fehlers) finden Sie in der [Tabelle der Fehlertypen](https://www.bulkgate.com/de/dokumentation/api-verwaltung-und-tokens/api-fehlertypen/)
- **code** ist der HTTP-Fehlercode
- **detail** enthält zusätzliche Informationen zum Fehler
