This page describes the
groups portion of the
Intouch REST API.
Endpoints
URI | Method | Returns | Notes |
/groups | GET | Array of groups | Get all groups. |
/groups | POST | A single group, with new GroupId. | Create a new group. You need to supply the group information as either XML or json. |
/groups/{id} | GET | A single group | Retrieve the information about a single group defined by the identifier. |
/groups/{id} | PUT | Status code 200, no content | Update a group based on the identifier. You need to supply the group information as either XML or json. |
/groups/{id} | DELETE | Status code 200, no content | Delete a group based on the identifier. |
/groups/{id}/contacts | GET | Array of contacts | Get all contacts in a group. |
/groups/{id}/contacts/{contactId} | PUT | Status code 200, no content | Use this to add an existing contacts to a group. New contacts are created using the contacts resource. |
/groups/{id}/contacts/{contactId} | DELETE | Status code 200, no content | Use this to remove a contacts from a group. The contact itself is not deleted by this operation. |
/groups/{id}/contacts/search/{text} | GET | Array of contacts | Used to search for contacts in a specific group. 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 or sending group 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
/groups/234:
{
"Description": "High value contacts"
"GroupId": 234,
"IsPrivate": false,
"Name": "Group A",
}
Sample data, returned by requesting resource
/groups/234/contacts which contains a single contact:
[{
"CPAAccepted":false,
"ContactId":60550,
"CreatedDate":"\/Date(1229070868890+0100)\/",
"Description":"a note",
"Description2":null,
"Description3":null,
"Email":null,
"Firstname":"Blaise",
"IsPrivate":false,
"Lastname":"Pascal",
"PhoneNumber":"97555597"
}]
XML
Sample data, returned by requesting resource
/groups:
<?xml version="1.0" encoding="utf-8"?>
<Group xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.datacontract.org/2004/07/PSWinCom.Intouch.API.Resources">
<Description>High value contacts</Description>
<GroupId>234</GroupId>
<IsPrivate>false</IsPrivate>
<Name>Group A</Name>
</Group>
Sample data, returned by requesting resource
/groups/234/contacts which contains a single contact:
<?xml version="1.0" encoding="utf-8"?>
<ArrayOfContact xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.datacontract.org/2004/07/PSWinCom.Intouch.API.Resources">
<Contact>
<CPAAccepted>false</CPAAccepted>
<ContactId>60550</ContactId>
<CreatedDate>2008-12-12T09:34:28.89</CreatedDate>
<Description>a note</Description>
<Description2
i:nil="true" />
<Description3
i:nil="true" />
<Email
i:nil="true" />
<Firstname>Blaise</Firstname>
<IsPrivate>false</IsPrivate>
<Lastname>Pascal</Lastname>
<PhoneNumber>97555597</PhoneNumber>
</Contact>
</ArrayOfContact>
See also