| GET | /{Workspace}/API/Team/Schema | ||
|---|---|---|---|
| GET, PUT, POST, DELETE | /{Workspace}/API/Team/{Id} | ||
| GET, PUT, POST, DELETE | /{Workspace}/API/Team |
Imports System
Imports System.Collections
Imports System.Collections.Generic
Imports System.Runtime.Serialization
Imports ServiceStack
Imports ServiceStack.DataAnnotations
Imports Field2Office.API.Model.PublicApi.Teams
Imports Field2Office.API.Model.Teams
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 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.PublicApi.Teams
<DataContract>
Public Partial Class PublicTeam
Public Sub New()
Teams = New List(Of Team)
End Sub
<DataMember>
Public Overridable Property Id As String
<DataMember>
Public Overridable Property Workspace As String
<DataMember>
Public Overridable Property Team As Team
<DataMember>
Public Overridable Property Teams As List(Of Team)
End Class
End Namespace
Namespace Field2Office.API.Model.Teams
'''<Summary>
'''Represents a DTO for a team in a workspace. Calls without an ObjectId will retrieve an array of all team objects for the workspace.
'''</Summary>
Public Partial Class Team
Public Sub New()
Members = New List(Of DomainItem)
Data = New Dictionary(Of String, String)
Teams = New List(Of String)
Events = New List(Of EventItem)
ActiveLaborTypes = New Dictionary(Of String, Object)
End Sub
Public Overridable Property Workspace As String
Public Overridable Property TimeZone As String
Public Overridable Property ObjectId As String
Public Overridable Property ExternalId As String
Public Overridable Property VersionId As String
Public Overridable Property BasedOn As String
Public Overridable Property Name As String
Public Overridable Property Enabled As Boolean
Public Overridable Property Members As List(Of DomainItem)
Public Overridable Property Lead As DomainItem
Public Overridable Property Parent As DomainItem
Public Overridable Property Address As Address
Public Overridable Property Data As Dictionary(Of String, String)
Public Overridable Property Teams As List(Of String)
Public Overridable Property Events As List(Of EventItem)
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 .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}/API/Team/{Id} HTTP/1.1
Host: dev.fieldsquared.com
Accept: application/xml
Content-Type: application/xml
Content-Length: length
<PublicTeam xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.datacontract.org/2004/07/Field2Office.API.Model.PublicApi.Teams">
<Id>String</Id>
<Team>
<City>String</City>
<Country>String</Country>
<Created>String</Created>
<Data xmlns:d3p1="http://schemas.microsoft.com/2003/10/Serialization/Arrays">
<d3p1:KeyValueOfstringanyType>
<d3p1:Key>String</d3p1:Key>
<d3p1:Value />
</d3p1:KeyValueOfstringanyType>
</Data>
<Enabled>false</Enabled>
<ExternalId>String</ExternalId>
<LastUpdated>String</LastUpdated>
<Lat>0</Lat>
<Lon>0</Lon>
<Members xmlns:d3p1="http://schemas.microsoft.com/2003/10/Serialization/Arrays">
<d3p1:string>String</d3p1:string>
</Members>
<Name>String</Name>
<State>String</State>
<StreetAddress>String</StreetAddress>
<Teams xmlns:d3p1="http://schemas.microsoft.com/2003/10/Serialization/Arrays">
<d3p1:string>String</d3p1:string>
</Teams>
<Unit>String</Unit>
<Zip>String</Zip>
</Team>
<Teams>
<Team>
<City>String</City>
<Country>String</Country>
<Created>String</Created>
<Data xmlns:d4p1="http://schemas.microsoft.com/2003/10/Serialization/Arrays">
<d4p1:KeyValueOfstringanyType>
<d4p1:Key>String</d4p1:Key>
<d4p1:Value />
</d4p1:KeyValueOfstringanyType>
</Data>
<Enabled>false</Enabled>
<ExternalId>String</ExternalId>
<LastUpdated>String</LastUpdated>
<Lat>0</Lat>
<Lon>0</Lon>
<Members xmlns:d4p1="http://schemas.microsoft.com/2003/10/Serialization/Arrays">
<d4p1:string>String</d4p1:string>
</Members>
<Name>String</Name>
<State>String</State>
<StreetAddress>String</StreetAddress>
<Teams xmlns:d4p1="http://schemas.microsoft.com/2003/10/Serialization/Arrays">
<d4p1:string>String</d4p1:string>
</Teams>
<Unit>String</Unit>
<Zip>String</Zip>
</Team>
</Teams>
<Workspace>String</Workspace>
</PublicTeam>