Field Squared API Services

<back to all web services

DiscreetDocumentSchema

The following routes are available for this service:
GET, PUT, POST, DELETE/{Workspace}/DiscreetDocumentSchema
GET, PUT POST, DELETE/{Workspace}/DiscreetDocumentSchema/{Type}
import Foundation
import ServiceStack

public class DiscreetDocumentSchema : Codable
{
    public var workspace:String
    public var created:String
    public var lastUpdated:String
    public var type:String
    public var name:String
    public var Description:String
    public var fieldDefs:[DiscreetDocumentField] = []
    public var enabled:Bool?

    required public init(){}
}

public class DiscreetDocumentField : Codable
{
    public var key:String
    public var name:String
    public var Description:String
    public var dataType:String
    public var indexed:Bool

    required public init(){}
}


Swift DiscreetDocumentSchema DTOs

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

HTTP + JSV

The following are sample HTTP requests and responses. The placeholders shown need to be replaced with actual values.

POST /{Workspace}/DiscreetDocumentSchema HTTP/1.1 
Host: dev.fieldsquared.com 
Accept: text/jsv
Content-Type: text/jsv
Content-Length: length

{
	Workspace: String,
	Created: String,
	LastUpdated: String,
	Type: String,
	Name: String,
	Description: String,
	FieldDefs: 
	[
		{
			Key: String,
			Name: String,
			Description: String,
			DataType: String,
			Indexed: False
		}
	],
	Enabled: False
}