| GET,POST,PUT,DELETE | /{Workspace}/Contact/{ObjectId} | ||
|---|---|---|---|
| GET | /{Workspace}/Contact | ||
| GET | /{Workspace}/ContactList | ||
| GET | /{Workspace}/ContactList/Count | ||
| GET | /{Workspace}/ContactTasks/{ObjectId} |
Imports System
Imports System.Collections
Imports System.Collections.Generic
Imports System.Runtime.Serialization
Imports ServiceStack
Imports ServiceStack.DataAnnotations
Imports Field2Office.API.Model.Contacts
Imports Field2Office.API.Model
Namespace Global
Namespace Field2Office.API.Model
Public Partial Class Address
Public Overridable Property Street As String
Public Overridable Property Unit As String
Public Overridable Property City As String
Public Overridable Property State As String
Public Overridable Property Zip As String
Public Overridable Property ContactTitle As String
Public Overridable Property ContactName As String
Public Overridable Property ContactPhone As String
Public Overridable Property ContactEmail As String
Public Overridable Property Location As Location
Public Overridable Property SiteName As String
Public Overridable Property GeocodeFailed As Boolean
Public Overridable Property Country As String
End Class
Public Partial Class ClassedItem
Public Sub New()
Ancestors = New List(Of String)
End Sub
Public Overridable Property ObjectId As String
Public Overridable Property [Class] As String
Public Overridable Property VersionId As String
Public Overridable Property Ancestors As List(Of String)
Public Overridable Property Type As String
End Class
Public Partial Class DomainItem
Public Overridable Property Workspace As String
Public Overridable Property ObjectId As String
Public Overridable Property VersionId As String
Public Overridable Property LastUpdated As String
End Class
Public Partial Class EventItem
Public Overridable Property ObjectId As String
Public Overridable Property [Date] As String
Public Overridable Property Location As Location
Public Overridable Property Barcode As String
Public Overridable Property Details As String
Public Overridable Property Type As String
Public Overridable Property IsScan As Boolean
Public Overridable Property User As String
Public Overridable Property SelectedBy As String
Public Overridable Property Status As String
Public Overridable Property StatusType As String
Public Overridable Property DateCreated As String
Public Overridable Property Automatic As Boolean
End Class
Public Partial Class Location
Public Overridable Property y As Double
Public Overridable Property x As Double
End Class
End Namespace
Namespace Field2Office.API.Model.Contacts
'''<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>
Public Partial Class Contact
Public Sub New()
ServiceAddresses = New List(Of Address)
Documents = New List(Of DomainItem)
Data = New Dictionary(Of String, String)
Tasks = New List(Of String)
Assets = New List(Of String)
Contacts = New List(Of String)
Events = New List(Of EventItem)
Teams = New List(Of String)
ActiveLaborTypes = New Dictionary(Of String, Object)
End Sub
Public Overridable Property Workspace As String
Public Overridable Property ObjectId As String
Public Overridable Property TimeZone As String
Public Overridable Property VersionId As String
Public Overridable Property BasedOn As String
Public Overridable Property ExternalId As String
Public Overridable Property ContactName As String
Public Overridable Property Company As String
Public Overridable Property MobilePhone As String
Public Overridable Property WorkPhone As String
Public Overridable Property HomePhone As String
Public Overridable Property Email As String
Public Overridable Property SMS As Boolean
Public Overridable Property Address As Address
Public Overridable Property Enabled As Boolean
Public Overridable Property POI As Boolean
Public Overridable Property EmailSiteDriving As Boolean
Public Overridable Property ServiceAddresses As List(Of Address)
Public Overridable Property Documents As List(Of DomainItem)
Public Overridable Property Data As Dictionary(Of String, String)
Public Overridable Property Owner As ClassedItem
Public Overridable Property Tasks As List(Of String)
Public Overridable Property Assets As List(Of String)
Public Overridable Property Contacts As List(Of String)
Public Overridable Property Events As List(Of EventItem)
Public Overridable Property Teams As List(Of String)
Public Overridable Property Created As String
Public Overridable Property LastUpdated As String
Public Overridable Property CreatedBy As String
Public Overridable Property ActiveLaborTypes As Dictionary(Of String, Object)
End Class
End Namespace
End Namespace
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}/Contact/{ObjectId} HTTP/1.1
Host: dev.fieldsquared.com
Accept: text/jsv
Content-Type: text/jsv
Content-Length: length
{
Workspace: String,
ObjectId: String,
TimeZone: String,
VersionId: String,
BasedOn: String,
ExternalId: String,
ContactName: String,
Company: String,
MobilePhone: String,
WorkPhone: String,
HomePhone: String,
Email: String,
SMS: False,
Address:
{
Street: String,
Unit: String,
City: String,
State: String,
Zip: String,
ContactTitle: String,
ContactName: String,
ContactPhone: String,
ContactEmail: String,
Location:
{
y: 0,
x: 0
},
SiteName: String,
GeocodeFailed: False,
Country: String
},
Enabled: False,
POI: False,
EmailSiteDriving: False,
ServiceAddresses:
[
{
Street: String,
Unit: String,
City: String,
State: String,
Zip: String,
ContactTitle: String,
ContactName: String,
ContactPhone: String,
ContactEmail: String,
Location:
{
y: 0,
x: 0
},
SiteName: String,
GeocodeFailed: False,
Country: String
}
],
Documents:
[
{
Workspace: String,
ObjectId: String,
VersionId: String,
LastUpdated: String
}
],
Data:
{
String: String
},
Owner:
{
ObjectId: String,
Class: String,
VersionId: String,
Ancestors:
[
String
],
Type: String
},
Tasks:
[
String
],
Assets:
[
String
],
Contacts:
[
String
],
Events:
[
{
ObjectId: String,
Date: String,
Location:
{
y: 0,
x: 0
},
Barcode: String,
Details: String,
Type: String,
IsScan: False,
User: String,
SelectedBy: String,
Status: String,
StatusType: String,
DateCreated: String,
Automatic: False
}
],
Teams:
[
String
],
Created: String,
LastUpdated: String,
CreatedBy: String,
ActiveLaborTypes:
{
String: {}
}
}