Field Squared API Services

<back to all web services

Contact

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

The following routes are available for this service:
GET,POST,PUT,DELETE/{Workspace}/Contact/{ObjectId}
GET/{Workspace}/Contact
GET/{Workspace}/ContactList
GET/{Workspace}/ContactList/Count
GET/{Workspace}/ContactTasks/{ObjectId}
namespace Field2Office.API.Model

open System
open System.Collections
open System.Collections.Generic
open System.Runtime.Serialization
open ServiceStack
open ServiceStack.DataAnnotations

    [<AllowNullLiteral>]
    type Location() = 
        member val y:Double = new Double() with get,set
        member val x:Double = new Double() with get,set

    [<AllowNullLiteral>]
    type Address() = 
        member val Street:String = null with get,set
        member val Unit:String = null with get,set
        member val City:String = null with get,set
        member val State:String = null with get,set
        member val Zip:String = null with get,set
        member val ContactTitle:String = null with get,set
        member val ContactName:String = null with get,set
        member val ContactPhone:String = null with get,set
        member val ContactEmail:String = null with get,set
        member val Location:Location = null with get,set
        member val SiteName:String = null with get,set
        member val GeocodeFailed:Boolean = new Boolean() with get,set
        member val Country:String = null with get,set

    [<AllowNullLiteral>]
    type DomainItem() = 
        member val Workspace:String = null with get,set
        member val ObjectId:String = null with get,set
        member val VersionId:String = null with get,set
        member val LastUpdated:String = null with get,set

    [<AllowNullLiteral>]
    type ClassedItem() = 
        member val ObjectId:String = null with get,set
        member val Class:String = null with get,set
        member val VersionId:String = null with get,set
        member val Ancestors:ResizeArray<String> = new ResizeArray<String>() with get,set
        member val Type:String = null with get,set

    [<AllowNullLiteral>]
    type EventItem() = 
        member val ObjectId:String = null with get,set
        member val Date:String = null with get,set
        member val Location:Location = null with get,set
        member val Barcode:String = null with get,set
        member val Details:String = null with get,set
        member val Type:String = null with get,set
        member val IsScan:Boolean = new Boolean() with get,set
        member val User:String = null with get,set
        member val SelectedBy:String = null with get,set
        member val Status:String = null with get,set
        member val StatusType:String = null with get,set
        member val DateCreated:String = null with get,set
        member val Automatic:Boolean = new Boolean() with get,set

    ///<summary>
    ///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
    ///</summary>
    [<AllowNullLiteral>]
    type Contact() = 
        member val Workspace:String = null with get,set
        member val ObjectId:String = null with get,set
        member val TimeZone:String = null with get,set
        member val VersionId:String = null with get,set
        member val BasedOn:String = null with get,set
        member val ExternalId:String = null with get,set
        member val ContactName:String = null with get,set
        member val Company:String = null with get,set
        member val MobilePhone:String = null with get,set
        member val WorkPhone:String = null with get,set
        member val HomePhone:String = null with get,set
        member val Email:String = null with get,set
        member val SMS:Boolean = new Boolean() with get,set
        member val Address:Address = null with get,set
        member val Enabled:Boolean = new Boolean() with get,set
        member val POI:Boolean = new Boolean() with get,set
        member val EmailSiteDriving:Boolean = new Boolean() with get,set
        member val ServiceAddresses:ResizeArray<Address> = new ResizeArray<Address>() with get,set
        member val Documents:ResizeArray<DomainItem> = new ResizeArray<DomainItem>() with get,set
        member val Data:Dictionary<String, String> = new Dictionary<String, String>() with get,set
        member val Owner:ClassedItem = null with get,set
        member val Tasks:ResizeArray<String> = new ResizeArray<String>() with get,set
        member val Assets:ResizeArray<String> = new ResizeArray<String>() with get,set
        member val Contacts:ResizeArray<String> = new ResizeArray<String>() with get,set
        member val Events:ResizeArray<EventItem> = new ResizeArray<EventItem>() with get,set
        member val Teams:ResizeArray<String> = new ResizeArray<String>() with get,set
        member val Created:String = null with get,set
        member val LastUpdated:String = null with get,set
        member val CreatedBy:String = null with get,set
        member val ActiveLaborTypes:Dictionary<String, Object> = new Dictionary<String, Object>() with get,set

F# Contact DTOs

To override the Content-type in your clients, use the HTTP Accept Header, append the .xml suffix or ?format=xml

HTTP + 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>