GET /api.xro/1.0/contacts
Gets all contact records for a particular Xero customer.
Request
| Parameter | Description |
| apiKey(Required) | Your partner API Key. |
| xeroKey(Required) | The Xero Customer Key generated by the Xero customer and provided to you to access their organisation data. |
| type | The contact type. Can be “customers”, “suppliers” or “all” (default’s to “all”). |
| sortBy | Currently only accepts “name” or “emailaddress” (default’s to “name”) |
| direction | Either “desc” or “asc” |
| updatedAfter | DateTime to filter contacts by. If specified only contacts with an UpdatedDateUTC greater than the date time specified will be returned, assumed to be in Coordinated Universal Time |
Example
To get all contacts that are customers perform the following HTTP request:
This will respond with the following XML document describing the contacts:
<Response> <ID>e3f25470-d80a-47d5-9bfc-2efd964c3cbd</ID> <Status>OK</Status> <ProviderName>XeroTest</ProviderName> <DateTimeUTC>2008-04-18T03:30:46.9953372Z </DateTimeUTC> <Contacts> <Contact> <ContactID>4c76ffb5-02e7-47c5-9a86-b0a5a35d1682</ContactID> <ContactNumber>C20081234</ContactNumber> <ContactStatus>ACTIVE</ContactStatus> <Name>Red House Reads</Name> <EmailAddress>accounts@redhousereads.co.nz</EmailAddress> <Addresses> <Address> <AddressType>STREET</AddressType> <AddressLine1></AddressLine1> <AddressLine2></AddressLine2> <AddressLine3></AddressLine3> <AddressLine4></AddressLine4> <City></City> <Region></Region> <PostalCode></PostalCode> <Country></Country> </Address> <Address> <AddressType>POBOX</AddressType> <AddressLine1>Lvl 1</AddressLine1> <AddressLine2>Herd St Building</AddressLine2> <AddressLine3>Herd St</AddressLine3> <AddressLine4>Wellington</AddressLine4> <City>Wellington</City> <Region>Wellington</Region> <PostalCode>6011</PostalCode> <Country>New Zealand</Country> </Address> </Addresses> <Phones> <Phone> <PhoneType>DDI</PhoneType> <PhoneNumber>1234567</PhoneNumber> <PhoneAreaCode>4</PhoneAreaCode> <PhoneCountryCode>64</PhoneCountryCode> </Phone> <Phone> <PhoneType>DEFAULT</PhoneType> <PhoneNumber>1234567</PhoneNumber> <PhoneAreaCode>4</PhoneAreaCode> <PhoneCountryCode>64</PhoneCountryCode> </Phone> <Phone> <PhoneType>MOBILE</PhoneType> <PhoneNumber>123123</PhoneNumber> <PhoneAreaCode>21</PhoneAreaCode> <PhoneCountryCode>64</PhoneCountryCode> </Phone> <Phone> <PhoneType>FAX</PhoneType> <PhoneNumber>1234568</PhoneNumber> <PhoneAreaCode>4</PhoneAreaCode> <PhoneCountryCode>64</PhoneCountryCode> </Phone> </Phones> <UpdatedDateUTC>2008-04-18T03:30:46</UpdatedDateUTC> <SkypeUserName>echo123</SkypeUserName> <BankAccountDetails>123-456-789</BankAccountDetails> </Contact> </Contacts> </Response>
Response Xml Schema
<?xml version="1.0" encoding="utf-8"?> <xs:schema attributeFormDefault="unqualified" elementFormDefault="qualified" xmlns:xs="http://www.w3.org/2001/XMLSchema"> <xs:element name="Response"> <xs:complexType> <xs:sequence> <xs:element name="ID" type="xs:string" /> <xs:element name="Status" type="xs:string" /> <xs:element name="ProviderName" type="xs:string" /> <xs:element name="DateTimeUTC" type="xs:dateTime" /> <xs:element name="Contacts"> <xs:complexType> <xs:sequence> <xs:element maxOccurs="unbounded" name="Contact"> <xs:complexType> <xs:sequence> <xs:element name="ContactID" type="xs:string" /> <xs:element minOccurs="0" name="ContactNumber" type="xs:string" /> <xs:element name="ContactStatus" type="xs:string" /> <xs:element name="Name" type="xs:string" /> <xs:element minOccurs="0" name="EmailAddress" type="xs:string" /> <xs:element name="Addresses"> <xs:complexType> <xs:sequence> <xs:element name="Address"> <xs:complexType> <xs:sequence> <xs:element name="AddressType" type="xs:string" /> <xs:element minOccurs="0" name="AddressLine1" type="xs:string" /> <xs:element minOccurs="0" name="AddressLine2" type="xs:string" /> <xs:element minOccurs="0" name="AddressLine3" type="xs:string" /> <xs:element minOccurs="0" name="AddressLine4" type="xs:string" /> <xs:element minOccurs="0" name="City" type="xs:string" /> <xs:element minOccurs="0" name="Region" type="xs:string" /> <xs:element minOccurs="0" name="PostalCode" type="xs:string" /> <xs:element minOccurs="0" name="Country" type="xs:string" /> </xs:sequence> </xs:complexType> </xs:element> </xs:sequence> </xs:complexType> </xs:element> <xs:element name="Phones"> <xs:complexType> <xs:sequence> <xs:element maxOccurs="unbounded" name="Phone"> <xs:complexType> <xs:sequence> <xs:element name="PhoneType" type="xs:string" /> <xs:element minOccurs="0" name="PhoneNumber" type="xs:string" /> <xs:element minOccurs="0" name="PhoneAreaCode" type="xs:string" /> <xs:element minOccurs="0" name="PhoneCountryCode" type="xs:string" /> </xs:sequence> </xs:complexType> </xs:element> </xs:sequence> </xs:complexType> </xs:element> <xs:element minOccurs="0" name="UpdatedDateUTC" type="xs:dateTime" /> <xs:element minOccurs="0" name="SkypeUserName" type="xs:string" /> <xs:element minOccurs="0" name="BankAccountDetails" type="xs:string" /> </xs:sequence> </xs:complexType> </xs:element> </xs:sequence> </xs:complexType> </xs:element> </xs:sequence> </xs:complexType> </xs:element> </xs:schema>