This page describes the
contacts portion of the
Intouch REST API.
Endpoints
URI | Method | Notes |
/contacts | GET | Get all contacts. This should not be done if you have many contacts. |
/contacts | POST | Create a new contact. You need to supply the contact information as either XML or json. |
/contacts/count | GET | Get total number of contacts. |
/contacts/{id} | GET | Retrieve the information about a single contact på the identifier. |
/contacts/{id} | PUT | Update a single contact defined by the identifier. You need to supply the contact information as either XML or json. |
/contacts/{id} | DELETE | Delete a single contact defined by the identifier. |
/contacts/phonenumber/{number} | GET | Get contact with specified phone number (exact match). |
/contacts/search/{text} | GET | Used to search for contacts. Searches in fields firstname, lastname, description, description2, description3, email, and phonenumber. You can provide multiple search terms, separated by space (%20). Contacts will then need to match on all provided terms. |
Data contract
When getting contact data or sending contact data to the server with POST or PUT you have the option of using either XML or JSON.
JSON
Sample data, returned by requesting resource
/contacts/3444:
{
"CPAAccepted": false,
"ContactId": 3444,
"CreatedDate": "\/Date(1217243648767+0200)\/",
"Description": "",
"Description2": null,
"Description3": null,
"Email": null,
"Firstname": "Ann Christin",
"IsPrivate": false,
"Lastname": "Pedersen",
"PhoneNumber": "90555817"
}
XML
Sample data, returned by requesting resource
/contacts/3444:
<?xml version="1.0" encoding="utf-8"?>
<Contact xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.datacontract.org/2004/07/PSWinCom.Intouch.API.Resources">
<CPAAccepted>false</CPAAccepted>
<ContactId>3444</ContactId>
<CreatedDate>2008-07-28T13:14:08.767</CreatedDate>
<Description></Description>
<Description2
i:nil="true" />
<Description3
i:nil="true" />
<Email
i:nil="true" />
<Firstname>Ann Christin</Firstname>
<IsPrivate>false</IsPrivate>
<Lastname>Pedersen</Lastname>
<PhoneNumber>90555817</PhoneNumber>
</Contact>
See also