ProSonata API
Folgende HTTP-Methoden stehen für Ansprechpartner zur Verfügung:
Zugriff ab Benutzergruppe Zeiterfasser 2.
GET /api/v1/contacts
Antwort:
{
"meta": {
"status": 200,
"perPage": 100,
"page": 1,
"totalCount": 85,
"requestUserID": 1,
"requestUsername": "Admin1",
"usergroupName": "Administrator",
"apiLimitRemaining": 436,
"apiLimitReset": 516
},
"data": [
{
"contactID": 48,
"title": "Herr",
"firstName": "Karl",
"lastName": "Schmidt",
"customerID": 10,
"customerName": "ABC Versicherung",
"addressID": 36,
"name1": "ABC Versicherung AG",
"name2": "",
"street": "Unfallstraße",
"streetNo": 23,
"postalCode": 12345,
"city": "Hamburg",
...
},
...
]
}
Über Parameter kann gefiltert werden:
GET /api/v1/contacts?lastName=Meier
| Parameter | Beschreibung |
|---|---|
| firstName | Vorname |
| lastName | Nachname |
| customerID | ID der Firma/Gruppe |
| customerName | Bezeichnung der Firma/Gruppe |
| addressID | ID der Adresse |
| name1 | Zeile 1 der Firmierung |
| name2 | Zeile 2 der Firmierung |
| name3 | Zeile 3 der Firmierung |
| addressName | interne Bezeichnung der Adresse |
| postalCode | Postleitzahl |
| city | Stadt |
| country | Land |
| comments | Anmerkungen zum Ansprechpartner |
| contactFilter1 (2, 3, …) | Filter 1 (oder 2, 3, …) |
| active | Kontakt aktiv: 0 = nein 1 = ja (Standard) |
Nach folgenden Parametern kann sortiert werden (Sortierrichtung ggf. mit ASC bzw. DESC ergänzen):
contactID, customerID, addressID, firstName, lastName, birthday, postalCode, city, country, accountManagerUserID, active
GET /api/v1/contacts/{id}
Antwort:
{
"meta": {
"status": 200,
"requestUserID": 1,
"requestUsername": "Admin1",
"usergroupName": "Administrator",
"apiLimitRemaining": 446,
"apiLimitReset": 723
},
"data": {
"contactID": 48,
"title": "Herr",
"firstName": "Karl",
"lastName": "Schmidt",
"customerID": 10,
"customerName": "ABC Versicherung",
"addressID": 36,
"name1": "ABC Versicherung AG",
"name2": "",
"street": "Unfallstraße",
"streetNo": 23,
"postalCode": 12345,
"city": "Hamburg",
"country": "",
"position": "",
"department": "",
"email": "karl.schmidt@versicherung.de",
"email2": "",
"telephone": "01234 5678945",
"fax": "",
"mobile": "",
"telephonePrivate": "",
"mobilePrivate": "",
"streetPrivate": "",
"streetNoPrivate": "",
"postalCodePrivate": "",
"cityPrivate": "",
"countryPrivate": "",
"usePrivateForCSV": 0,
"messenger": "",
"socialMedia": "",
"website": "",
"comments": "",
"birthday": "1967-02-07",
"contactFilter1": 0,
"contactFilter2": 1,
"contactFilter3": 1,
"contactFilter4": 1,
"contactFilter5": 0,
"contactFilter6": 0,
"contactFilter7": 0,
"contactFilter8": 0,
"contactFilter9": 0,
"contactFilter10": 0,
"accountManagerUserID": null,
"createdByUserID": 1,
"contactCreationDate": null,
"editedByUserID": 1,
"active": 1,
"isLocked": 0,
"contactViaApi": 0
}
}
POST /api/v1/contacts
Eine neue Firma/Gruppe bzw. eine neue Adresse muss zunächst über die entsprechende Ressource erstellt werden!
Notwendige und mögliche Parameter im Body:
| Parameter | Beschreibung | Typ | Default-Wert | Pflichtfeld |
|---|---|---|---|---|
| title | Anrede: Herr Frau Herr Dr. Frau Dr. … |
String | ja | |
| firstName | Vorname | String | ||
| lastName | Nachname | String | ja | |
| customerID | ID der Firma/Gruppe die Firma/Gruppe muss vorhanden sein, ansonsten wird ein 409-Fehler zurückgegeben |
Int | ja | |
| addressID | ID der Adresse die Adresse muss vorhanden sein |
Int | ja | |
| position | Position | String | ||
| department | Abteilung | String | ||
| E-Mail-Adresse | String | |||
| email2 | E-Mail-Adresse 2 | String | ||
| telephone | Telefonnummer | String | ||
| fax | Faxnummer | String | ||
| mobile | Mobilnummer | String | ||
| telephonePrivate | private Telefonnummer | String | ||
| mobilePrivate | private Mobilnummer | String | ||
| streetPrivate | private Straße | String | ||
| streetNoPrivate | private Hausnummer | String | ||
| postalCodePrivate | private PLZ | String | ||
| cityPrivate | private Stadt | String | ||
| countryPrivate | privates Land | String | ||
| usePrivateForCSV | private Adresse für CSV-Exporte verwenden | Int | 0 | |
| messenger | Messenger Adresse | String | ||
| socialMedia | Social Media Profil | String | ||
| website | Website | String | ||
| comments | Anmerkungen | String | ||
| birthday | Geburtstag | Date | null | |
| contactFilter1 (2, 3, …) | Filter 1 (oder 2, 3, …) aktiv 0 = nein 1 = ja |
Int | 0 | |
| accountManagerUserID | Kundenbetreuer (Benutzer ID) | Int | null | |
| active | Ansprechpartner aktiv 0 = nein 1 = ja |
Int | 0 |
Beispiel:
{
"title": "Herr",
"firstName": "Karl",
"lastName": "Schmidt",
"customerID": 10,
"addressID": 36,
"email": "karl.schmidt@versicherung.de",
"telephone": "01234 5678945",
"birthday": "1967-02-07",
"contactFilter1": 1,
"contactFilter3": 1
}