API

Authorization

As a registered and logged in user with admin rights for your account, you can create a API token (Bearer token) to use in other software.

Bearer Token example "14|bj0c3kcWm50wid9FCfek1633QjxMhgPyE2RJwT8p"

Resource Contacts

GET /api/v1/apicontacts

Get all of your contacts, but without the trashed ones and without the ones who have an adblock set.

Response:
{
    "data": [
        {
            "id": 10000,
            "gender": "m",
            "salutitle": null,
            "salutation": "Herr",
            "saluletter": "Sehr geehrter Herr",
            "firstname": "Toni",
            "lastname": "Burri-Burri",
            "address": "Sabine-Schärer-Strasse 6b",
            "postalcode": "2403",
            "city": "Saillon",
            "region": null,
            "country": "CH",
            "phone": "+41 (0)00 537 38 64",
            "email": "mark47@bluewin.ch",
            "birthdate": "09.09.1954",
            "billto": "private",
            "billname": null,
            "billaddress": "Sabine-Schärer-Strasse 6b",
            "billpostalcode": "2403",
            "billcity": "Saillon",
            "billregion": null,
            "billcountry": "CH"
        },
        {
            ...
        }
    ]
}

GET by id /api/v1/apicontacts/10000

Response:
{
    "id": 10000,
    "gender": "m",
    "salutitle": null,
    "salutation": "Herr",
    "saluletter": "Sehr geehrter Herr",
    "firstname": "Toni",
    "lastname": "Burri-Burri",
    "address": "Sabine-Schärer-Strasse 6b",
    "postalcode": "2403",
    "city": "Saillon",
    "region": null,
    "country": "CH",
    "phone": "+41 (0)00 537 38 64",
    "email": "mark47@bluewin.ch",
    "birthdate": "09.09.1954",
    "billto": "private",
    "billname": null,
    "billaddress": "Sabine-Schärer-Strasse 6b",
    "billpostalcode": "2403",
    "billcity": "Saillon",
    "billregion": null,
    "billcountry": "CH"
}

Addresses

Every contact has a private address and a billing address. The billing address is used for documents. A family and/or organisation can be assigned to the contact. The application allows to assign four options for the billing address source. Contact field name „billto“:
1. „private“ (default)
2. „other“
3. „family“ (if family is assigned)
4. „organization“ (if organization is assigned)
The API allows only two options for the billing address:
1. „private“ –> the billing address is set to private address (provided values will be ignored).
2. „other“ –> the billing address is set to the provided values.
If the field „billto“ is not provided in POST requests, the default „private“ will be applied.
If the field „billto“ is not provided in PUT requests, all the bill_-fields will be ignored.

POST /api/v1/apicontacts

Body JSON:
{
    "gender": "f",           //m, f, d    (male, female, divers)
    "salutitle": null,
    "salutation": "Frau",
    "saluletter": "Sehr geehrte Frau",
    "firstname": "Sonja",    //mandatory
    "lastname": "Meier",     //mandatory
    "address": "Schärerstrasse 6b",
    "postalcode": "2403",
    "city": "Aarau",
    "region": null,
    "country": "CH",
    "phone": "+41 (0)62 537 38 64",
    "email": "apili@bluewin.ch",
    "birthdate": "09.09.1972"
}
Response:
[
    "Contact created successfully.",
    {
        "id": 10140,
        "gender": "f",
        "salutitle": null,
        "salutation": "Frau",
        "saluletter": "Sehr geehrte Frau",
        "firstname": "Sonja",
        "lastname": "Meier",
        "address": "Schärerstrasse 6b",
        "postalcode": "2403",
        "city": "Aarau",
        "region": null,
        "country": "CH",
        "phone": "+41 (0)62 537 38 64",
        "email": "apili@bluewin.ch",
        "birthdate": "09.09.1972",
        "billto": "private",
        "billname": null,
        "billaddress": "Schärerstrasse 6b",
        "billpostalcode": "2403",
        "billcity": "Aarau",
        "billregion": null,
        "billcountry": "CH"
    }
]

PUT /api/v1/apicontacts/10003

Update contact with billing address set to private address

Body JSON:
{
    "id": 10003,          //must be equal to id in url
    "gender": "m",
    "salutitle": null,
    "salutation": "Herr",
    "saluletter": "Sehr geehrter Herr",
    "firstname": "Toni",    //mandatory
    "lastname": "Burri",    //mandatory
    "address": "Schärerstrasse 6b",
    "postalcode": "2403",
    "city": "Saillon",
    "region": null,
    "country": "CH",
    "phone": "+41 062 537 38 64",
    "email": "mark@bluewin.ch",
    "birthdate": "09.09.1954",
    "billto": "private"        //billing address is set to private address
}
Response:
[
    "Contact updated successfully.",
    {
        "id": 10003,
        "gender": "m",
        "salutitle": null,
        "salutation": "Herr",
        "saluletter": "Sehr geehrter Herr",
        "firstname": "Toni",
        "lastname": "Burri",
        "address": "Schärerstrasse 6b",
        "postalcode": "2403",
        "city": "Saillon",
        "region": null,
        "country": "CH",
        "phone": "+41 062 537 38 64",
        "email": "mark47@bluewin.ch",
        "birthdate": "09.09.1954",
        "billto": "private",
        "billname": null,
        "billaddress": "Schärerstrasse 6b",
        "billpostalcode": "2403",
        "billcity": "Saillon",
        "billregion": null,
        "billcountry": "CH"
    }
]

Update contact with billing address set to „other“ address

Body JSON:
{
    "id": 10000,
    "gender": "m",
    "salutitle": null,
    "salutation": "Herr",
    "saluletter": "Sehr geehrter Herr",
    "firstname": "Toni",
    "lastname": "Burri",
    "address": "Schärerstrasse 6b",
    "postalcode": "2403",
    "city": "Saillon",
    "region": null,
    "country": "CH",
    "phone": "+41 (0)00 537 38 64",
    "email": "mark47@bluewin.ch",
    "birthdate": "09.09.1954",
    "billto": "other",
    "billaddress": "Bahnhofstrasse 22",
    "billpostalcode": "6000",
    "billcity": "Luzern",
    "billregion": "LU",
    "billcountry": "CH"
}
Response:
[
    "Contact updated successfully.",
    {
        "id": 10000,
        "gender": "m",
        "salutitle": null,
        "salutation": "Herr",
        "saluletter": "Sehr geehrter Herr",
        "firstname": "Toni",
        "lastname": "Burri",
        "address": "Schärerstrasse 6b",
        "postalcode": "2403",
        "city": "Saillon",
        "region": null,
        "country": "CH",
        "phone": "+41 (0)00 537 38 64",
        "email": "mark47@bluewin.ch",
        "birthdate": "09.09.1954",
        "billto": "other",
        "billname": null,
        "billaddress": "Bahnhofstrasse 22",
        "billpostalcode": "6000",
        "billcity": "Luzern",
        "billregion": "LU",
        "billcountry": "CH"
    }
]