Intouch REST Resource: Contacts

Modified on Wed, 24 Nov 2010 06:29 by tormar — Categorized as: Intouch

This page describes the contacts portion of the Intouch REST API.

Table of Contents [Hide/Show]


Endpoints

URIMethodNotes
/contactsGETGet all contacts. This should not be done if you have many contacts.
/contactsPOSTCreate a new contact. You need to supply the contact information as either XML or json.
/contacts/countGETGet total number of contacts.
/contacts/{id}GETRetrieve the information about a single contact på the identifier.
/contacts/{id}PUTUpdate a single contact defined by the identifier. You need to supply the contact information as either XML or json.
/contacts/{id}DELETEDelete a single contact defined by the identifier.
/contacts/phonenumber/{number}GETGet contact with specified phone number (exact match).
/contacts/search/{text}GETUsed 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