Zum Inhalt

Adresse

Mit dieser Api werden die Adressen ausgegeben.

Felder

Siehe Benutzer Facette addresses

Eine Adresse auslesen

Die URL /api/account/address/[AID] liefert eine Adresse zurück

{
    "dataset": {
        "485db45f-b697-4271-8a9c-5a19c45557b4": {
            "aid": 47,
            "uid": 20,
            "contact": "",
            "company": "",
            "address1": "Teststrasse 222",
            "address2": "",
            "city": "Teststadt",
            "state": "",
            "zipcode": "12345",
            "country": "de",
            "description": "",
            "type": "4",
            "preset": 1,
            "systemUsage": "",
            "erpID": "",
            "erpName": "",
            "erpNumber": "",
            "erpLastUpdate": "0000-01-01T00:00:00",
            "erpCreation": "0000-01-01T00:00:00",
            "archived": "0"
        }
    },
    "sys": {
        "pagination": {
            "total": 1,
            "currentPage": 1,
            "objectsPerPage": 20,
            "offset": 0,
            "nextOffset": null,
            "prevOffset": null,
            "pages": 1
        },
        "message": "200 OK",
        "code": 200
    }
}

Adressen auslesen

Die URL /api/account/address?page=[SEITE]&count=[ANZAHL DER OBJEKTE]&orderby=[SORTIERUNG] liefert alle Adressen zurück. Mit dem Pagestepper kann durch die Daten navigiert werden.

Beispiel : /api/account/address?page=0&count=5

{
    "dataset": {
        "66681c38-1094-4490-e416-9d431fa5ef57": {},
        "caec026c-b9a0-4ea7-af27-0b36e8c47cbd": {},
        "9f9a232a-efc4-4079-f091-035fdb8f1b4c": {},
        "1b3da6a2-994f-4060-a47d-38c12a19a416": {},
        "7555bb79-f8d0-461b-d488-008819447df2": {}
    },
    "sys": {
        "pagination": {
            "total": 47,
            "currentPage": 3,
            "objectsPerPage": 5,
            "offset": 10,
            "nextOffset": 15,
            "prevOffset": 5,
            "pages": 10
        },
        "message": "200 OK",
        "code": 200
    }
}

Adressen suchen

Über die URL /api/account/address/search?q=[QUERY] können Adressen gesucht werden. Mit dem Pagestepper kann durch die Daten navigiert werden.

Beispiel suche nach Postleitzahlen: /api/account/address/search?q=zipcode%3D12345

{
    "dataset": {
        "1": {},
        "187": {},
        "362": {},
    },
    "sys": {
        "pagination": {
            "total": 47,
            "currentPage": 3,
            "objectsPerPage": 5,
            "offset": 10,
            "nextOffset": 15,
            "prevOffset": 5,
            "pages": 10
        },
        "message": "200 OK",
        "code": 200
    }
}

Adressen hinzufügen

mit der Methode POST an die URL /api/account/address können Adressen hinzugefügt werden.

Hinweis

Beim Hinzufügen muss die uid des Benutzers übergeben werden

{
    "dataset": [
         {
            "uid": 20,
            "address1": "Eichenstrasse 26",
            "city": "Landsberied",
            "zipcode": "18597",
            "country": "de",
            "type": "0"
        },{
            "uid": 20,
            "address1": "Dorbaumstr. 89",
            "city": "Schönwalde",
            "zipcode": "18597",
            "country": "de",
            "type": "0"
        }
    ]
}

Antwort

{
    "dataset": [
        {
            "sys": {
                "message": "201 Created",
                "code": 201,
                "created": "2018-08-11T04:10:51"
            },
            "dataset": {
                "uid": 20,
                "contact": "",
                "company": "",
                "address1": "Eichenstrasse 26",
                "address2": "",
                "city": "Landsberied",
                "state": "",
                "zipcode": "18597",
                "country": "de",
                "description": "",
                "type": "0",
                "preset": 0,
                "systemUsage": "",
                "erpID": "",
                "erpName": "",
                "erpNumber": "",
                "erpLastUpdate": "1970-01-01 01:00:00",
                "erpCreation": "1970-01-01 01:00:00",
                "archived": "0",
                "aid": "51"
            }
        },
        {
            "sys": {
                "message": "201 Created",
                "code": 201,
                "created": "2018-08-11T04:10:51"
            },
            "dataset": {
                "uid": 20,
                "contact": "",
                "company": "",
                "address1": "Dorbaumstr. 89",
                "address2": "",
                "city": "Schönwalde",
                "state": "",
                "zipcode": "18597",
                "country": "de",
                "description": "",
                "type": "0",
                "preset": 0,
                "systemUsage": "",
                "erpID": "",
                "erpName": "",
                "erpNumber": "",
                "erpLastUpdate": "1970-01-01 01:00:00",
                "erpCreation": "1970-01-01 01:00:00",
                "archived": "0",
                "aid": "52"
            }
        }
    ],
    "sys": {
        "message": "201 Created",
        "code": 201
    }
}

Adresse ändern

Mit der Methode PUT auf die URL /api/account/address kann eine Adressen geändert werden.

Hinweis

Bei Änderungen muss immer der komplette Datensatz übergeben werden, die Felder die nicht übergeben werden, werden gelöscht.

{
    "dataset": [
      {
            "uid": 20,
            "contact": "",
            "company": "",
            "address1": "Dorbaumstr. 89",
            "address2": "",
            "city": "Schönwalde",
            "state": "",
            "zipcode": "18597",
            "country": "de",
            "description": "",
            "type": "0",
            "preset": 0,
            "systemUsage": "",
            "erpID": "",
            "erpName": "",
            "erpNumber": "",
            "erpLastUpdate": "1970-01-01 01:00:00",
            "erpCreation": "1970-01-01 01:00:00",
            "archived": "0",
            "aid": "52"
        }
    ]
}

Antwort

{
    "dataset": [
        {
            "sys": {
                "updated": "2018-08-11T04:15:42",
                "message": "200 OK",
                "code": 200
            },
            "dataset": {
                "uid": 20,
                "contact": "",
                "company": "",
                "address1": "Eichenstrasse 26",
                "address2": "",
                "city": "Landsberied",
                "state": "",
                "zipcode": "69258",
                "country": "de",
                "description": "",
                "type": "0",
                "preset": 0,
                "systemUsage": "",
                "erpID": "",
                "erpName": "",
                "erpNumber": "",
                "erpLastUpdate": "1970-01-01 01:00:00",
                "erpCreation": "1970-01-01 01:00:00",
                "archived": "0",
                "aid": "51"
            }
        },
        {
            "sys": {
                "updated": "2018-08-11T04:15:42",
                "message": "200 OK",
                "code": 200
            },
            "dataset": {
                "uid": 20,
                "contact": "",
                "company": "",
                "address1": "Dorbaumstr. 89",
                "address2": "",
                "city": "Schönwalde",
                "state": "",
                "zipcode": "86598",
                "country": "de",
                "description": "",
                "type": "0",
                "preset": 0,
                "systemUsage": "",
                "erpID": "",
                "erpName": "",
                "erpNumber": "",
                "erpLastUpdate": "1970-01-01 01:00:00",
                "erpCreation": "1970-01-01 01:00:00",
                "archived": "0",
                "aid": "52"
            }
        }
    ],
    "sys": {
        "message": "200 OK",
        "code": 200
    }
}

Adresse löschen

Mit der Methode DELETE auf die URL /api/account/address/[AID] kann eine Adresse gelöscht werden.

{
    "sys": {
        "message": "200 OK",
        "code": 200
    }
}