| GET,POST,PUT,DELETE | /{Workspace}/Contact/{ObjectId} | ||
|---|---|---|---|
| GET | /{Workspace}/Contact | ||
| GET | /{Workspace}/ContactList | ||
| GET | /{Workspace}/ContactList/Count | ||
| GET | /{Workspace}/ContactTasks/{ObjectId} |
import java.math.*;
import java.util.*;
import net.servicestack.client.*;
public class dtos
{
/**
* Represents a DTO for a contact in a workspace. Calls without an ObjectId will retrieve an array of all active contact objects for the workspace.A call to /{Workspace}/ContactTasks/{ObjectId} will return a List<DomainItem> for the list of tasks associated to the contact.A core or custom sort field can be specified by using sort=fieldname&sortorder=ascending/descending. To filter for contacts based on full text search, use fulltext Custom contact field 'contains' filters can also be specified by using the binding/key as the query parameter. i.e. Comments=Quick Brown Fox. To filter and return all contacts modified since a date and time, use the query parameter modifiedsince = X where X = YYYY-MM-DDTHH:MM:SSZ To filter and return all contacts deleted since a date and time, use the query parameter deletedsince = X where X = YYYY-MM-DDTHH:MM:SSZ. Note only Object ID, Workspace and Version is populated. Spatial extents can be passed in using: bottomleft=Lat,Lon&topright=Lat,Lon. To filter on tasks inside a boundary, use boundary=Lat,Lon,Lat,Lon etc. Pagination - /{0}/ContactList?recstart=0&reccount=1 /{Workspace}/ContactList/Count returns a count, not the actual object list
*/
public static class Contact
{
public String Workspace = null;
public String ObjectId = null;
public String TimeZone = null;
public String VersionId = null;
public String BasedOn = null;
public String ExternalId = null;
public String ContactName = null;
public String Company = null;
public String MobilePhone = null;
public String WorkPhone = null;
public String HomePhone = null;
public String Email = null;
public Boolean SMS = null;
public Address Address = null;
public Boolean Enabled = null;
public Boolean POI = null;
public Boolean EmailSiteDriving = null;
public ArrayList<Address> ServiceAddresses = null;
public ArrayList<DomainItem> Documents = null;
public HashMap<String,String> Data = null;
public ClassedItem Owner = null;
public ArrayList<String> Tasks = null;
public ArrayList<String> Assets = null;
public ArrayList<String> Contacts = null;
public ArrayList<EventItem> Events = null;
public ArrayList<String> Teams = null;
public String Created = null;
public String LastUpdated = null;
public String CreatedBy = null;
public HashMap<String,Object> ActiveLaborTypes = null;
public String getWorkspace() { return Workspace; }
public Contact setWorkspace(String value) { this.Workspace = value; return this; }
public String getObjectId() { return ObjectId; }
public Contact setObjectId(String value) { this.ObjectId = value; return this; }
public String getTimeZone() { return TimeZone; }
public Contact setTimeZone(String value) { this.TimeZone = value; return this; }
public String getVersionId() { return VersionId; }
public Contact setVersionId(String value) { this.VersionId = value; return this; }
public String getBasedOn() { return BasedOn; }
public Contact setBasedOn(String value) { this.BasedOn = value; return this; }
public String getExternalId() { return ExternalId; }
public Contact setExternalId(String value) { this.ExternalId = value; return this; }
public String getContactName() { return ContactName; }
public Contact setContactName(String value) { this.ContactName = value; return this; }
public String getCompany() { return Company; }
public Contact setCompany(String value) { this.Company = value; return this; }
public String getMobilePhone() { return MobilePhone; }
public Contact setMobilePhone(String value) { this.MobilePhone = value; return this; }
public String getWorkPhone() { return WorkPhone; }
public Contact setWorkPhone(String value) { this.WorkPhone = value; return this; }
public String getHomePhone() { return HomePhone; }
public Contact setHomePhone(String value) { this.HomePhone = value; return this; }
public String getEmail() { return Email; }
public Contact setEmail(String value) { this.Email = value; return this; }
public Boolean isSms() { return SMS; }
public Contact setSms(Boolean value) { this.SMS = value; return this; }
public Address getAddress() { return Address; }
public Contact setAddress(Address value) { this.Address = value; return this; }
public Boolean isEnabled() { return Enabled; }
public Contact setEnabled(Boolean value) { this.Enabled = value; return this; }
public Boolean isPoi() { return POI; }
public Contact setPoi(Boolean value) { this.POI = value; return this; }
public Boolean isEmailSiteDriving() { return EmailSiteDriving; }
public Contact setEmailSiteDriving(Boolean value) { this.EmailSiteDriving = value; return this; }
public ArrayList<Address> getServiceAddresses() { return ServiceAddresses; }
public Contact setServiceAddresses(ArrayList<Address> value) { this.ServiceAddresses = value; return this; }
public ArrayList<DomainItem> getDocuments() { return Documents; }
public Contact setDocuments(ArrayList<DomainItem> value) { this.Documents = value; return this; }
public HashMap<String,String> getData() { return Data; }
public Contact setData(HashMap<String,String> value) { this.Data = value; return this; }
public ClassedItem getOwner() { return Owner; }
public Contact setOwner(ClassedItem value) { this.Owner = value; return this; }
public ArrayList<String> getTasks() { return Tasks; }
public Contact setTasks(ArrayList<String> value) { this.Tasks = value; return this; }
public ArrayList<String> getAssets() { return Assets; }
public Contact setAssets(ArrayList<String> value) { this.Assets = value; return this; }
public ArrayList<String> getContacts() { return Contacts; }
public Contact setContacts(ArrayList<String> value) { this.Contacts = value; return this; }
public ArrayList<EventItem> getEvents() { return Events; }
public Contact setEvents(ArrayList<EventItem> value) { this.Events = value; return this; }
public ArrayList<String> getTeams() { return Teams; }
public Contact setTeams(ArrayList<String> value) { this.Teams = value; return this; }
public String getCreated() { return Created; }
public Contact setCreated(String value) { this.Created = value; return this; }
public String getLastUpdated() { return LastUpdated; }
public Contact setLastUpdated(String value) { this.LastUpdated = value; return this; }
public String getCreatedBy() { return CreatedBy; }
public Contact setCreatedBy(String value) { this.CreatedBy = value; return this; }
public HashMap<String,Object> getActiveLaborTypes() { return ActiveLaborTypes; }
public Contact setActiveLaborTypes(HashMap<String,Object> value) { this.ActiveLaborTypes = value; return this; }
}
public static class Address
{
public String Street = null;
public String Unit = null;
public String City = null;
public String State = null;
public String Zip = null;
public String ContactTitle = null;
public String ContactName = null;
public String ContactPhone = null;
public String ContactEmail = null;
public Location Location = null;
public String SiteName = null;
public Boolean GeocodeFailed = null;
public String Country = null;
public String getStreet() { return Street; }
public Address setStreet(String value) { this.Street = value; return this; }
public String getUnit() { return Unit; }
public Address setUnit(String value) { this.Unit = value; return this; }
public String getCity() { return City; }
public Address setCity(String value) { this.City = value; return this; }
public String getState() { return State; }
public Address setState(String value) { this.State = value; return this; }
public String getZip() { return Zip; }
public Address setZip(String value) { this.Zip = value; return this; }
public String getContactTitle() { return ContactTitle; }
public Address setContactTitle(String value) { this.ContactTitle = value; return this; }
public String getContactName() { return ContactName; }
public Address setContactName(String value) { this.ContactName = value; return this; }
public String getContactPhone() { return ContactPhone; }
public Address setContactPhone(String value) { this.ContactPhone = value; return this; }
public String getContactEmail() { return ContactEmail; }
public Address setContactEmail(String value) { this.ContactEmail = value; return this; }
public Location getLocation() { return Location; }
public Address setLocation(Location value) { this.Location = value; return this; }
public String getSiteName() { return SiteName; }
public Address setSiteName(String value) { this.SiteName = value; return this; }
public Boolean isGeocodeFailed() { return GeocodeFailed; }
public Address setGeocodeFailed(Boolean value) { this.GeocodeFailed = value; return this; }
public String getCountry() { return Country; }
public Address setCountry(String value) { this.Country = value; return this; }
}
public static class Location
{
public Double y = null;
public Double x = null;
public Double getY() { return y; }
public Location setY(Double value) { this.y = value; return this; }
public Double getX() { return x; }
public Location setX(Double value) { this.x = value; return this; }
}
public static class DomainItem
{
public String Workspace = null;
public String ObjectId = null;
public String VersionId = null;
public String LastUpdated = null;
public String getWorkspace() { return Workspace; }
public DomainItem setWorkspace(String value) { this.Workspace = value; return this; }
public String getObjectId() { return ObjectId; }
public DomainItem setObjectId(String value) { this.ObjectId = value; return this; }
public String getVersionId() { return VersionId; }
public DomainItem setVersionId(String value) { this.VersionId = value; return this; }
public String getLastUpdated() { return LastUpdated; }
public DomainItem setLastUpdated(String value) { this.LastUpdated = value; return this; }
}
public static class ClassedItem
{
public String ObjectId = null;
public String Class = null;
public String VersionId = null;
public ArrayList<String> Ancestors = null;
public String Type = null;
public String getObjectId() { return ObjectId; }
public ClassedItem setObjectId(String value) { this.ObjectId = value; return this; }
public String getClass() { return Class; }
public ClassedItem setClass(String value) { this.Class = value; return this; }
public String getVersionId() { return VersionId; }
public ClassedItem setVersionId(String value) { this.VersionId = value; return this; }
public ArrayList<String> getAncestors() { return Ancestors; }
public ClassedItem setAncestors(ArrayList<String> value) { this.Ancestors = value; return this; }
public String getType() { return Type; }
public ClassedItem setType(String value) { this.Type = value; return this; }
}
public static class EventItem
{
public String ObjectId = null;
public String Date = null;
public Location Location = null;
public String Barcode = null;
public String Details = null;
public String Type = null;
public Boolean IsScan = null;
public String User = null;
public String SelectedBy = null;
public String Status = null;
public String StatusType = null;
public String DateCreated = null;
public Boolean Automatic = null;
public String getObjectId() { return ObjectId; }
public EventItem setObjectId(String value) { this.ObjectId = value; return this; }
public String getDate() { return Date; }
public EventItem setDate(String value) { this.Date = value; return this; }
public Location getLocation() { return Location; }
public EventItem setLocation(Location value) { this.Location = value; return this; }
public String getBarcode() { return Barcode; }
public EventItem setBarcode(String value) { this.Barcode = value; return this; }
public String getDetails() { return Details; }
public EventItem setDetails(String value) { this.Details = value; return this; }
public String getType() { return Type; }
public EventItem setType(String value) { this.Type = value; return this; }
public Boolean getIsScan() { return IsScan; }
public EventItem setIsScan(Boolean value) { this.IsScan = value; return this; }
public String getUser() { return User; }
public EventItem setUser(String value) { this.User = value; return this; }
public String getSelectedBy() { return SelectedBy; }
public EventItem setSelectedBy(String value) { this.SelectedBy = value; return this; }
public String getStatus() { return Status; }
public EventItem setStatus(String value) { this.Status = value; return this; }
public String getStatusType() { return StatusType; }
public EventItem setStatusType(String value) { this.StatusType = value; return this; }
public String getDateCreated() { return DateCreated; }
public EventItem setDateCreated(String value) { this.DateCreated = value; return this; }
public Boolean isAutomatic() { return Automatic; }
public EventItem setAutomatic(Boolean value) { this.Automatic = value; return this; }
}
}
To override the Content-type in your clients, use the HTTP Accept Header, append the .xml suffix or ?format=xml
The following are sample HTTP requests and responses. The placeholders shown need to be replaced with actual values.
POST /{Workspace}/Contact/{ObjectId} HTTP/1.1
Host: dev.fieldsquared.com
Accept: application/xml
Content-Type: application/xml
Content-Length: length
<Contact xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.datacontract.org/2004/07/Field2Office.API.Model.Contacts">
<ActiveLaborTypes xmlns:d2p1="http://schemas.microsoft.com/2003/10/Serialization/Arrays">
<d2p1:KeyValueOfstringanyType>
<d2p1:Key>String</d2p1:Key>
<d2p1:Value />
</d2p1:KeyValueOfstringanyType>
</ActiveLaborTypes>
<Address xmlns:d2p1="http://schemas.datacontract.org/2004/07/Field2Office.API.Model">
<d2p1:City>String</d2p1:City>
<d2p1:ContactEmail>String</d2p1:ContactEmail>
<d2p1:ContactName>String</d2p1:ContactName>
<d2p1:ContactPhone>String</d2p1:ContactPhone>
<d2p1:ContactTitle>String</d2p1:ContactTitle>
<d2p1:Country>String</d2p1:Country>
<d2p1:GeocodeFailed>false</d2p1:GeocodeFailed>
<d2p1:Location>
<d2p1:x>0</d2p1:x>
<d2p1:y>0</d2p1:y>
</d2p1:Location>
<d2p1:SiteName>String</d2p1:SiteName>
<d2p1:State>String</d2p1:State>
<d2p1:Street>String</d2p1:Street>
<d2p1:Unit>String</d2p1:Unit>
<d2p1:Zip>String</d2p1:Zip>
</Address>
<Assets xmlns:d2p1="http://schemas.microsoft.com/2003/10/Serialization/Arrays">
<d2p1:string>String</d2p1:string>
</Assets>
<BasedOn>String</BasedOn>
<Company>String</Company>
<ContactName>String</ContactName>
<Contacts xmlns:d2p1="http://schemas.microsoft.com/2003/10/Serialization/Arrays">
<d2p1:string>String</d2p1:string>
</Contacts>
<Created>String</Created>
<CreatedBy>String</CreatedBy>
<Data xmlns:d2p1="http://schemas.microsoft.com/2003/10/Serialization/Arrays">
<d2p1:KeyValueOfstringstring>
<d2p1:Key>String</d2p1:Key>
<d2p1:Value>String</d2p1:Value>
</d2p1:KeyValueOfstringstring>
</Data>
<Documents xmlns:d2p1="http://schemas.datacontract.org/2004/07/Field2Office.API.Model">
<d2p1:DomainItem>
<d2p1:LastUpdated>String</d2p1:LastUpdated>
<d2p1:ObjectId>String</d2p1:ObjectId>
<d2p1:VersionId>String</d2p1:VersionId>
<d2p1:Workspace>String</d2p1:Workspace>
</d2p1:DomainItem>
</Documents>
<Email>String</Email>
<EmailSiteDriving>false</EmailSiteDriving>
<Enabled>false</Enabled>
<Events xmlns:d2p1="http://schemas.datacontract.org/2004/07/Field2Office.API.Model">
<d2p1:EventItem>
<d2p1:Automatic>false</d2p1:Automatic>
<d2p1:Barcode>String</d2p1:Barcode>
<d2p1:Date>String</d2p1:Date>
<d2p1:DateCreated>String</d2p1:DateCreated>
<d2p1:Details>String</d2p1:Details>
<d2p1:IsScan>false</d2p1:IsScan>
<d2p1:Location>
<d2p1:x>0</d2p1:x>
<d2p1:y>0</d2p1:y>
</d2p1:Location>
<d2p1:ObjectId>String</d2p1:ObjectId>
<d2p1:SelectedBy>String</d2p1:SelectedBy>
<d2p1:Status>String</d2p1:Status>
<d2p1:StatusType>String</d2p1:StatusType>
<d2p1:Type>String</d2p1:Type>
<d2p1:User>String</d2p1:User>
</d2p1:EventItem>
</Events>
<ExternalId>String</ExternalId>
<HomePhone>String</HomePhone>
<LastUpdated>String</LastUpdated>
<MobilePhone>String</MobilePhone>
<ObjectId>String</ObjectId>
<Owner xmlns:d2p1="http://schemas.datacontract.org/2004/07/Field2Office.API.Model">
<d2p1:Ancestors xmlns:d3p1="http://schemas.microsoft.com/2003/10/Serialization/Arrays">
<d3p1:string>String</d3p1:string>
</d2p1:Ancestors>
<d2p1:Class>String</d2p1:Class>
<d2p1:ObjectId>String</d2p1:ObjectId>
<d2p1:Type>String</d2p1:Type>
<d2p1:VersionId>String</d2p1:VersionId>
</Owner>
<POI>false</POI>
<SMS>false</SMS>
<ServiceAddresses xmlns:d2p1="http://schemas.datacontract.org/2004/07/Field2Office.API.Model">
<d2p1:Address>
<d2p1:City>String</d2p1:City>
<d2p1:ContactEmail>String</d2p1:ContactEmail>
<d2p1:ContactName>String</d2p1:ContactName>
<d2p1:ContactPhone>String</d2p1:ContactPhone>
<d2p1:ContactTitle>String</d2p1:ContactTitle>
<d2p1:Country>String</d2p1:Country>
<d2p1:GeocodeFailed>false</d2p1:GeocodeFailed>
<d2p1:Location>
<d2p1:x>0</d2p1:x>
<d2p1:y>0</d2p1:y>
</d2p1:Location>
<d2p1:SiteName>String</d2p1:SiteName>
<d2p1:State>String</d2p1:State>
<d2p1:Street>String</d2p1:Street>
<d2p1:Unit>String</d2p1:Unit>
<d2p1:Zip>String</d2p1:Zip>
</d2p1:Address>
</ServiceAddresses>
<Tasks xmlns:d2p1="http://schemas.microsoft.com/2003/10/Serialization/Arrays">
<d2p1:string>String</d2p1:string>
</Tasks>
<Teams xmlns:d2p1="http://schemas.microsoft.com/2003/10/Serialization/Arrays">
<d2p1:string>String</d2p1:string>
</Teams>
<TimeZone>String</TimeZone>
<VersionId>String</VersionId>
<WorkPhone>String</WorkPhone>
<Workspace>String</Workspace>
</Contact>