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 elementDescriptionTypeDefault valueMandatory
client_idID of the clientINTyes
labelLabelALNUM
nameCompany nameALNUM
streetStreetALNUM
zipZip codeALNUM
cityCityALNUM
stateState, county, district, regionALNUM
country_codeCountryCountry code as ISO 3166 Alpha-2
first_nameFirst nameALNUM
last_nameLast nameALNUM
salutationSalutationALNUM
phonePhoneALNUM
faxFaxALNUM
mobileMobile NumberALNUM
emailEmailvalid Email addresse
wwwWebsiteURL (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.