# Daten-Input

Die multisource•api kann Eingangsdaten auf zwei Arten verarbeiten – entweder direkt über die **API (AddRecords)** oder per **Datei-Upload**.

## AddRecords (API-basierter Input)

Das Mapping und Dateneinspielung kann direkt über die API erfolgen.

## PUT /AddressProcessing/AddRecords

>

```json
{"openapi":"3.0.1","info":{"title":"Multisource API","version":"1.0"},"servers":[{"url":"https://api.multisource.ch/v2","description":"Production - v2"},{"url":"https://api.multisource.ch","description":"Production"},{"url":"https://apitep.multisource.ch","description":"Pre-Production Testing"}],"security":[{"bearer":[]}],"components":{"securitySchemes":{"bearer":{"type":"http","description":"Please enter a valid token","scheme":"bearer","bearerFormat":"JWT"}},"schemas":{"BatchProcessingApiRecord":{"type":"object","properties":{"customerId":{"type":"string","nullable":true},"classification":{"type":"string","nullable":true},"dwhId":{"type":"string","nullable":true},"beac":{"type":"integer","format":"int32","nullable":true},"egid":{"type":"string","nullable":true},"edid":{"type":"string","nullable":true},"postAddressId":{"type":"string","nullable":true},"firstname":{"type":"string","nullable":true},"companyName":{"type":"string","nullable":true},"name":{"type":"string","nullable":true},"birthDate":{"type":"string","nullable":true},"street":{"type":"string","nullable":true},"streetNo":{"type":"string","nullable":true},"streetAdd":{"type":"string","nullable":true},"careOf":{"type":"string","nullable":true},"poBox":{"type":"string","nullable":true},"poZip":{"type":"string","nullable":true},"poTown":{"type":"string","nullable":true},"zip":{"type":"string","nullable":true},"town":{"type":"string","nullable":true},"mobileNo":{"type":"string","nullable":true},"phoneNo":{"type":"string","nullable":true},"email":{"type":"string","nullable":true},"uid":{"type":"string","nullable":true},"chnr":{"type":"string","nullable":true},"freetext1":{"type":"string","nullable":true},"freetext2":{"type":"string","nullable":true},"freetext3":{"type":"string","nullable":true},"freetext4":{"type":"string","nullable":true},"freetext5":{"type":"string","nullable":true}},"additionalProperties":false}}},"paths":{"/AddressProcessing/AddRecords":{"put":{"tags":["Neartime - AddressProcessing"],"parameters":[{"name":"id","in":"query","schema":{"type":"integer","format":"int32"}},{"name":"uid","in":"query","schema":{"type":"string","format":"uuid"}}],"requestBody":{"content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/BatchProcessingApiRecord"}}},"text/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/BatchProcessingApiRecord"}}},"application/*+json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/BatchProcessingApiRecord"}}}}},"responses":{"200":{"description":"OK"}}}}}}
```

## Datei-Upload

Beim Datei-Upload können Kundendaten in einer beliebigen strukturierten Form hochgeladen werden, z.B. als **TXT**, **CSV**, **TSV** oder **XLSX**.

Für das Mapping stehen zwei Optionen zur Verfügung:

<table data-card-size="large" data-view="cards"><thead><tr><th></th><th></th></tr></thead><tbody><tr><td><h4>Standard-Mapping</h4></td><td>Die multisource•api stellt ein vorkonfiguriertes Standard-Mapping bereit, das die gängigsten Feldbezeichnungen abdeckt (Name, Vorname, Strasse, Hausnummer, PLZ, Ort usw.).</td></tr><tr><td><h4>Individuelles Mapping</h4></td><td><p>Alternativ kann ein kundenspezifisches Mapping definiert werden. Dieses wird im Rahmen des Onboardings gemeinsam erstellt.</p><p>Es können auch mehrere Mappings parallel definiert werden – z. B. wenn Daten aus unterschiedlichen Quellsystemen mit variierenden Feldstrukturen angeliefert werden.</p></td></tr></tbody></table>

{% hint style="info" %}
Die API kann grundsätzlich mit nahezu jedem strukturierten Datenformat umgehen.

Für ein optimales Matching sollten mindestens die Felder **Name**, **Vorname**, **Strasse**, **Hausnummer**, **PLZ** und **Ort** befüllt werden.
{% endhint %}

## POST /AddressProcessing/FileUpload

>

```json
{"openapi":"3.0.1","info":{"title":"Multisource API","version":"1.0"},"servers":[{"url":"https://api.multisource.ch/v2","description":"Production - v2"},{"url":"https://api.multisource.ch","description":"Production"},{"url":"https://apitep.multisource.ch","description":"Pre-Production Testing"}],"security":[{"bearer":[]}],"components":{"securitySchemes":{"bearer":{"type":"http","description":"Please enter a valid token","scheme":"bearer","bearerFormat":"JWT"}}},"paths":{"/AddressProcessing/FileUpload":{"post":{"tags":["Neartime - AddressProcessing"],"parameters":[{"name":"batchId","in":"query","schema":{"type":"integer","format":"int32"}},{"name":"batchUid","in":"query","schema":{"type":"string","format":"uuid"}},{"name":"description","in":"query","schema":{"type":"string"}}],"requestBody":{"content":{"multipart/form-data":{"schema":{"type":"object","properties":{"file":{"type":"string","format":"binary"}}},"encoding":{"file":{"style":"form"}}}}},"responses":{"200":{"description":"OK"}}}}}}
```
