Querying Data

Basic Get Action

The ability to Query for information is wrapped up by any Action ending in the word Get - ie, ContactGet, VehicleGet, etc. The best way to think about these Actions is as Criteria objects where you can basically specify any combination of parameters to filter data. The only required parameter on ALL Get Actions is the Serial Number, as mentioned before this specifies which dealership we're querying against. Note that any criteria left empty are ignored. You can either exclude the xml element altogether or simply not fill it in and then the PartnerHub won't use it as a Criteria.

<ContactGet xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.datacontract.org/2004/07/PBS.PartnerHub.ServiceModel">
  <ContactCode>String</ContactCode>
  <ContactId>00000000-0000-0000-0000-000000000000</ContactId>
  <EmailAddress>String</EmailAddress>
  <LastName>String</LastName>
  <ModifiedSince>0001-01-01T00:00:00</ModifiedSince>
  <PhoneNumber>String</PhoneNumber>
  <SerialNumber>String</SerialNumber>
</ContactGet>

Using this design you can actually perform very dynamic and unique queries. For example the following ContactGet looks for a specific customer by code.

<ContactGet xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.datacontract.org/2004/07/PBS.PartnerHub.ServiceModel">
  <ContactCode>123456</ContactCode>
  <SerialNumber>2002</SerialNumber>
</ContactGet>

This next request searches for all Customers with a certain last name.

<ContactGet xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.datacontract.org/2004/07/PBS.PartnerHub.ServiceModel">
  <LastName>SMITH</ContactCode>
  <SerialNumber>2002</SerialNumber>
</ContactGet>

Now, this request searches for all Customers modified since April 1, 2013.

<ContactGet xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.datacontract.org/2004/07/PBS.PartnerHub.ServiceModel">
  <ModifiedSince>2013-04-01T00:00:00</ContactCode>
  <SerialNumber>2002</SerialNumber>
</ContactGet>