| GET | /{Workspace}/API/Document/Schema | ||
|---|---|---|---|
| GET, PUT, POST, DELETE | /{Workspace}/API/Document/{Id} | ||
| GET, PUT, POST, DELETE | /{Workspace}/API/Document | ||
| GET | /{Workspace}/API/Document/Schema/{DocumentType} |
import java.math.*;
import java.util.*;
import net.servicestack.client.*;
public class dtos
{
@DataContract
public static class PublicDocument
{
@DataMember
public String Id = null;
@DataMember
public String Workspace = null;
@DataMember
public String DocumentType = null;
@DataMember
public Document Document = null;
@DataMember
public ArrayList<Document> Documents = null;
public String getId() { return Id; }
public PublicDocument setId(String value) { this.Id = value; return this; }
public String getWorkspace() { return Workspace; }
public PublicDocument setWorkspace(String value) { this.Workspace = value; return this; }
public String getDocumentType() { return DocumentType; }
public PublicDocument setDocumentType(String value) { this.DocumentType = value; return this; }
public Document getDocument() { return Document; }
public PublicDocument setDocument(Document value) { this.Document = value; return this; }
public ArrayList<Document> getDocuments() { return Documents; }
public PublicDocument setDocuments(ArrayList<Document> value) { this.Documents = value; return this; }
}
/**
* Represents a document associated with a task or user. To return multiple documents, call /{Workspace}/Document and pass in query parameter ids = comma separated list of document ids.
*/
public static class Document
{
public String Workspace = null;
public String AssignedWorkspace = null;
public String ObjectId = null;
public String VersionId = null;
public String BasedOn = null;
public String Created = null;
public String ExternalId = null;
public String LastUpdated = null;
public String Type = null;
public String Name = null;
public String Title = null;
public HashMap<String,Object> Data = null;
public ClassedItem Owner = null;
public ArrayList<ClassedItem> SecondaryOwners = null;
public Location Location = null;
public String Date = null;
public String CreatedBy = null;
public Double PercentComplete = null;
public Integer PercentTotal = null;
public Integer PercentDone = null;
public ArrayList<RangeExceptionItem> RangeExceptions = null;
public Boolean Submitted = null;
public String Schema = null;
public DocumentOwnerData OwnerData = null;
public String getWorkspace() { return Workspace; }
public Document setWorkspace(String value) { this.Workspace = value; return this; }
public String getAssignedWorkspace() { return AssignedWorkspace; }
public Document setAssignedWorkspace(String value) { this.AssignedWorkspace = value; return this; }
public String getObjectId() { return ObjectId; }
public Document setObjectId(String value) { this.ObjectId = value; return this; }
public String getVersionId() { return VersionId; }
public Document setVersionId(String value) { this.VersionId = value; return this; }
public String getBasedOn() { return BasedOn; }
public Document setBasedOn(String value) { this.BasedOn = value; return this; }
public String getCreated() { return Created; }
public Document setCreated(String value) { this.Created = value; return this; }
public String getExternalId() { return ExternalId; }
public Document setExternalId(String value) { this.ExternalId = value; return this; }
public String getLastUpdated() { return LastUpdated; }
public Document setLastUpdated(String value) { this.LastUpdated = value; return this; }
public String getType() { return Type; }
public Document setType(String value) { this.Type = value; return this; }
public String getName() { return Name; }
public Document setName(String value) { this.Name = value; return this; }
public String getTitle() { return Title; }
public Document setTitle(String value) { this.Title = value; return this; }
public HashMap<String,Object> getData() { return Data; }
public Document setData(HashMap<String,Object> value) { this.Data = value; return this; }
public ClassedItem getOwner() { return Owner; }
public Document setOwner(ClassedItem value) { this.Owner = value; return this; }
public ArrayList<ClassedItem> getSecondaryOwners() { return SecondaryOwners; }
public Document setSecondaryOwners(ArrayList<ClassedItem> value) { this.SecondaryOwners = value; return this; }
public Location getLocation() { return Location; }
public Document setLocation(Location value) { this.Location = value; return this; }
public String getDate() { return Date; }
public Document setDate(String value) { this.Date = value; return this; }
public String getCreatedBy() { return CreatedBy; }
public Document setCreatedBy(String value) { this.CreatedBy = value; return this; }
public Double getPercentComplete() { return PercentComplete; }
public Document setPercentComplete(Double value) { this.PercentComplete = value; return this; }
public Integer getPercentTotal() { return PercentTotal; }
public Document setPercentTotal(Integer value) { this.PercentTotal = value; return this; }
public Integer getPercentDone() { return PercentDone; }
public Document setPercentDone(Integer value) { this.PercentDone = value; return this; }
public ArrayList<RangeExceptionItem> getRangeExceptions() { return RangeExceptions; }
public Document setRangeExceptions(ArrayList<RangeExceptionItem> value) { this.RangeExceptions = value; return this; }
public Boolean isSubmitted() { return Submitted; }
public Document setSubmitted(Boolean value) { this.Submitted = value; return this; }
public String getSchema() { return Schema; }
public Document setSchema(String value) { this.Schema = value; return this; }
public DocumentOwnerData getOwnerData() { return OwnerData; }
public Document setOwnerData(DocumentOwnerData value) { this.OwnerData = 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 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 RangeExceptionItem
{
public String Binding = null;
public String Message = null;
public String Type = null;
public String ClassName = null;
public String getBinding() { return Binding; }
public RangeExceptionItem setBinding(String value) { this.Binding = value; return this; }
public String getMessage() { return Message; }
public RangeExceptionItem setMessage(String value) { this.Message = value; return this; }
public String getType() { return Type; }
public RangeExceptionItem setType(String value) { this.Type = value; return this; }
public String getClassName() { return ClassName; }
public RangeExceptionItem setClassName(String value) { this.ClassName = value; return this; }
}
public static class DocumentOwnerData
{
public String OwnerType = null;
public DocumentOwnerDataTask TaskData = null;
public DocumentOwnerDataAsset AssetData = null;
public String getOwnerType() { return OwnerType; }
public DocumentOwnerData setOwnerType(String value) { this.OwnerType = value; return this; }
public DocumentOwnerDataTask getTaskData() { return TaskData; }
public DocumentOwnerData setTaskData(DocumentOwnerDataTask value) { this.TaskData = value; return this; }
public DocumentOwnerDataAsset getAssetData() { return AssetData; }
public DocumentOwnerData setAssetData(DocumentOwnerDataAsset value) { this.AssetData = value; return this; }
}
public static class DocumentOwnerDataTask
{
public String ObjectId = null;
public String Name = null;
public String Status = null;
public String TaskType = null;
public Date LastUpdated = null;
public Date Created = null;
public Integer Priority = null;
public BigDecimal Rank = null;
public Team FirstTeam = null;
public Address Address = null;
public ArrayList<CustomDataField> CustomDataFields = null;
public String getObjectId() { return ObjectId; }
public DocumentOwnerDataTask setObjectId(String value) { this.ObjectId = value; return this; }
public String getName() { return Name; }
public DocumentOwnerDataTask setName(String value) { this.Name = value; return this; }
public String getStatus() { return Status; }
public DocumentOwnerDataTask setStatus(String value) { this.Status = value; return this; }
public String getTaskType() { return TaskType; }
public DocumentOwnerDataTask setTaskType(String value) { this.TaskType = value; return this; }
public Date getLastUpdated() { return LastUpdated; }
public DocumentOwnerDataTask setLastUpdated(Date value) { this.LastUpdated = value; return this; }
public Date getCreated() { return Created; }
public DocumentOwnerDataTask setCreated(Date value) { this.Created = value; return this; }
public Integer getPriority() { return Priority; }
public DocumentOwnerDataTask setPriority(Integer value) { this.Priority = value; return this; }
public BigDecimal getRank() { return Rank; }
public DocumentOwnerDataTask setRank(BigDecimal value) { this.Rank = value; return this; }
public Team getFirstTeam() { return FirstTeam; }
public DocumentOwnerDataTask setFirstTeam(Team value) { this.FirstTeam = value; return this; }
public Address getAddress() { return Address; }
public DocumentOwnerDataTask setAddress(Address value) { this.Address = value; return this; }
public ArrayList<CustomDataField> getCustomDataFields() { return CustomDataFields; }
public DocumentOwnerDataTask setCustomDataFields(ArrayList<CustomDataField> value) { this.CustomDataFields = value; return this; }
}
/**
* Represents a DTO for a team in a workspace. Calls without an ObjectId will retrieve an array of all team objects for the workspace.
*/
public static class Team
{
public String Workspace = null;
public String TimeZone = null;
public String ObjectId = null;
public String ExternalId = null;
public String VersionId = null;
public String BasedOn = null;
public String Name = null;
public Boolean Enabled = null;
public ArrayList<DomainItem> Members = null;
public DomainItem Lead = null;
public DomainItem Parent = null;
public Address Address = null;
public HashMap<String,String> Data = null;
public ArrayList<String> Teams = null;
public ArrayList<EventItem> Events = null;
public String CreatedBy = null;
public HashMap<String,Object> ActiveLaborTypes = null;
public String getWorkspace() { return Workspace; }
public Team setWorkspace(String value) { this.Workspace = value; return this; }
public String getTimeZone() { return TimeZone; }
public Team setTimeZone(String value) { this.TimeZone = value; return this; }
public String getObjectId() { return ObjectId; }
public Team setObjectId(String value) { this.ObjectId = value; return this; }
public String getExternalId() { return ExternalId; }
public Team setExternalId(String value) { this.ExternalId = value; return this; }
public String getVersionId() { return VersionId; }
public Team setVersionId(String value) { this.VersionId = value; return this; }
public String getBasedOn() { return BasedOn; }
public Team setBasedOn(String value) { this.BasedOn = value; return this; }
public String getName() { return Name; }
public Team setName(String value) { this.Name = value; return this; }
public Boolean isEnabled() { return Enabled; }
public Team setEnabled(Boolean value) { this.Enabled = value; return this; }
public ArrayList<DomainItem> getMembers() { return Members; }
public Team setMembers(ArrayList<DomainItem> value) { this.Members = value; return this; }
public DomainItem getLead() { return Lead; }
public Team setLead(DomainItem value) { this.Lead = value; return this; }
public DomainItem getParent() { return Parent; }
public Team setParent(DomainItem value) { this.Parent = value; return this; }
public Address getAddress() { return Address; }
public Team setAddress(Address value) { this.Address = value; return this; }
public HashMap<String,String> getData() { return Data; }
public Team setData(HashMap<String,String> value) { this.Data = value; return this; }
public ArrayList<String> getTeams() { return Teams; }
public Team setTeams(ArrayList<String> value) { this.Teams = value; return this; }
public ArrayList<EventItem> getEvents() { return Events; }
public Team setEvents(ArrayList<EventItem> value) { this.Events = value; return this; }
public String getCreatedBy() { return CreatedBy; }
public Team setCreatedBy(String value) { this.CreatedBy = value; return this; }
public HashMap<String,Object> getActiveLaborTypes() { return ActiveLaborTypes; }
public Team setActiveLaborTypes(HashMap<String,Object> value) { this.ActiveLaborTypes = 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 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 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; }
}
public static class Address extends AddressBase
{
public String SiteName = null;
public String ContactTitle = null;
public String ContactName = null;
public String ContactPhone = null;
public String ContactEmail = null;
public String getSiteName() { return SiteName; }
public Address setSiteName(String value) { this.SiteName = 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 static class AddressBase
{
public String Id = null;
public String AddressLine1 = null;
public String AddressLine2 = null;
public String City = null;
public String State = null;
public String Zip = null;
public Location Location = null;
public String Name = null;
public String NameSingleLine = null;
public String NameSingleLine5DigitZip = null;
public Boolean HasValidLocation = null;
public Boolean GeocodeFailed = null;
public String GeocodeResultCode = null;
public String Country = null;
public String getId() { return Id; }
public AddressBase setId(String value) { this.Id = value; return this; }
public String getAddressLine1() { return AddressLine1; }
public AddressBase setAddressLine1(String value) { this.AddressLine1 = value; return this; }
public String getAddressLine2() { return AddressLine2; }
public AddressBase setAddressLine2(String value) { this.AddressLine2 = value; return this; }
public String getCity() { return City; }
public AddressBase setCity(String value) { this.City = value; return this; }
public String getState() { return State; }
public AddressBase setState(String value) { this.State = value; return this; }
public String getZip() { return Zip; }
public AddressBase setZip(String value) { this.Zip = value; return this; }
public Location getLocation() { return Location; }
public AddressBase setLocation(Location value) { this.Location = value; return this; }
public String getName() { return Name; }
public AddressBase setName(String value) { this.Name = value; return this; }
public String getNameSingleLine() { return NameSingleLine; }
public AddressBase setNameSingleLine(String value) { this.NameSingleLine = value; return this; }
public String getNameSingleLine5DigitZip() { return NameSingleLine5DigitZip; }
public AddressBase setNameSingleLine5DigitZip(String value) { this.NameSingleLine5DigitZip = value; return this; }
public Boolean isHasValidLocation() { return HasValidLocation; }
public AddressBase setHasValidLocation(Boolean value) { this.HasValidLocation = value; return this; }
public Boolean isGeocodeFailed() { return GeocodeFailed; }
public AddressBase setGeocodeFailed(Boolean value) { this.GeocodeFailed = value; return this; }
public String getGeocodeResultCode() { return GeocodeResultCode; }
public AddressBase setGeocodeResultCode(String value) { this.GeocodeResultCode = value; return this; }
public String getCountry() { return Country; }
public AddressBase setCountry(String value) { this.Country = value; return this; }
}
public static class Location
{
public Double Latitude = null;
public Double Longitude = null;
public Boolean HasValidLocation = null;
public Double getLatitude() { return Latitude; }
public Location setLatitude(Double value) { this.Latitude = value; return this; }
public Double getLongitude() { return Longitude; }
public Location setLongitude(Double value) { this.Longitude = value; return this; }
public Boolean isHasValidLocation() { return HasValidLocation; }
public Location setHasValidLocation(Boolean value) { this.HasValidLocation = value; return this; }
}
public static class CustomDataField
{
public String Binding = null;
public String Label = null;
public Object Value = null;
public String DataType = null;
public Boolean IsReadOnly = null;
public Boolean IsHidden = null;
public String Values = null;
public String getBinding() { return Binding; }
public CustomDataField setBinding(String value) { this.Binding = value; return this; }
public String getLabel() { return Label; }
public CustomDataField setLabel(String value) { this.Label = value; return this; }
public Object getValue() { return Value; }
public CustomDataField setValue(Object value) { this.Value = value; return this; }
public String getDataType() { return DataType; }
public CustomDataField setDataType(String value) { this.DataType = value; return this; }
public Boolean getIsReadOnly() { return IsReadOnly; }
public CustomDataField setIsReadOnly(Boolean value) { this.IsReadOnly = value; return this; }
public Boolean getIsHidden() { return IsHidden; }
public CustomDataField setIsHidden(Boolean value) { this.IsHidden = value; return this; }
public String getValues() { return Values; }
public CustomDataField setValues(String value) { this.Values = value; return this; }
}
public static class DocumentOwnerDataAsset
{
public String ObjectId = null;
public String Name = null;
public String AssetType = null;
public Date LastUpdated = null;
public Date Created = null;
public AddressBasic Address = null;
public ArrayList<CustomDataField> CustomDataFields = null;
public String getObjectId() { return ObjectId; }
public DocumentOwnerDataAsset setObjectId(String value) { this.ObjectId = value; return this; }
public String getName() { return Name; }
public DocumentOwnerDataAsset setName(String value) { this.Name = value; return this; }
public String getAssetType() { return AssetType; }
public DocumentOwnerDataAsset setAssetType(String value) { this.AssetType = value; return this; }
public Date getLastUpdated() { return LastUpdated; }
public DocumentOwnerDataAsset setLastUpdated(Date value) { this.LastUpdated = value; return this; }
public Date getCreated() { return Created; }
public DocumentOwnerDataAsset setCreated(Date value) { this.Created = value; return this; }
public AddressBasic getAddress() { return Address; }
public DocumentOwnerDataAsset setAddress(AddressBasic value) { this.Address = value; return this; }
public ArrayList<CustomDataField> getCustomDataFields() { return CustomDataFields; }
public DocumentOwnerDataAsset setCustomDataFields(ArrayList<CustomDataField> value) { this.CustomDataFields = value; return this; }
}
public static class AddressBasic extends AddressBase
{
}
}
To override the Content-type in your clients, use the HTTP Accept Header, append the .jsv suffix or ?format=jsv
The following are sample HTTP requests and responses. The placeholders shown need to be replaced with actual values.
POST /{Workspace}/API/Document/{Id} HTTP/1.1
Host: dev.fieldsquared.com
Accept: text/jsv
Content-Type: text/jsv
Content-Length: length
{
Id: String,
Workspace: String,
DocumentType: String,
Document:
{
Name: String,
ExternalId: String,
Type: String,
OwnerId: String,
OwnerClass: String,
Lat: 0,
Lon: 0,
LastUpdated: String,
Created: String,
Date: String,
PercentComplete: 0,
PercentTotal: 0,
PercentDone: 0,
Data:
{
String: {}
}
},
Documents:
[
{
Name: String,
ExternalId: String,
Type: String,
OwnerId: String,
OwnerClass: String,
Lat: 0,
Lon: 0,
LastUpdated: String,
Created: String,
Date: String,
PercentComplete: 0,
PercentTotal: 0,
PercentDone: 0,
Data:
{
String: {}
}
}
]
}