List all contacts

GET /api/contacts?client_id={client_id}

Contacts can only be returned for a particular client.
Therefore client_id is a mandatory parameter.

<?xml version="1.0" encoding="UTF-8"?>
<contacts type="array" page="1" per_page="100" total="2">
    <contact>
        ...
    </contact>
    <contact>
        ...
    </contact>
</contacts>

Get a single contact

GET /api/contacts/{id}
<?xml version="1.0" encoding="UTF-8"?>
<contact>
    <id type="integer">4</id>
    <client_id type="integer">134432</client_id>
    <name></name>
    <salutation>Mr</salutation>
    <first_name>Jane</first_name>
    <last_name>Doe</last_name>
    <street></street>
    <zip></zip>
    <city></city>
    <state></state>
    <country_code></country_code>
    <phone></phone>
    <fax></fax>
    <mobile></mobile>
    <email>j.doe@example.com</email>
    <www></www>
</contact>

Create contact

POST /api/contacts
XML element Description Type Default value Mandatory
client_id ID of the client INT yes
label Label ALNUM
name Company name ALNUM
street Street ALNUM
zip Zip code ALNUM
city City ALNUM
state State, county, district, region ALNUM
country_code Country Country code as ISO 3166 Alpha-2
first_name First name ALNUM
last_name Last name ALNUM
salutation Salutation ALNUM
phone Phone ALNUM
fax Fax ALNUM
mobile Mobile Number ALNUM
email Email valid Email addresse
www Website URL (w/o http)

When a field is empty the client’s value is taken.

<contact>
    <client_id type="integer">134432</client_id>
    <name></name>
    <salutation>Mrs</salutation>
    <first_name>Jane</first_name>
    <last_name>Doe</last_name>
    <street></street>
    <zip></zip>
    <city></city>
    <state></state>
    <country_code></country_code>
    <phone></phone>
    <fax></fax>
    <mobile></mobile>
    <email></email>
    <www></www>
</contact>
<?xml version="1.0" encoding="UTF-8"?>
<contact>
    <id type="integer">4</id>
    <created type="datetime">2013-05-27T12:07:37+02:00</created>
    <client_id type="integer">134432</client_id>
    <name></name>
    <salutation>Mrs</salutation>
    <first_name>Jane</first_name>
    <last_name>Doe</last_name>
    <street></street>
    <zip></zip>
    <city></city>
    <state></state>
    <country_code></country_code>
    <phone></phone>
    <fax></fax>
    <mobile></mobile>
    <email></email>
    <www></www>
</contact>

Edit contacts

PUT /api/contacts/{id}

Here the same parameters apply as for creating.

<contact>
    <first_name>John</first_name>
    <last_name>Doe</last_name>
</contact>

Delete contact

DELETE /api/contacts/{id}

Show a contact image (avatar)

GET /api/contacts/{id}/avatar?size={size}

Returns the avatar for the contact with the given ID. The image is cut square. The size in pixels can be specified by the size paramater.