sfgboxapi

<back to all web services

FoodGardensAdd

Requires Authentication
The following routes are available for this service:
POST/food_gardens
import Foundation
import ServiceStack

// @DataContract
public class FoodGardensAdd : Codable
{
    // @DataMember(Order=2)
    // @Validate(Validator="NotNull")
    public var tenantsId:Int

    // @DataMember(Order=3)
    // @Validate(Validator="NotNull")
    public var name:String

    // @DataMember(Order=4)
    public var Description:String

    required public init(){}
}

public class FoodGardensAddResponse : Codable
{
    // @DataMember(Order=2)
    public var tenantsId:Int

    // @DataMember(Order=3)
    public var name:String

    // @DataMember(Order=4)
    public var Description:String

    // @DataMember(Order=6)
    public var responseStatus:ResponseStatus

    required public init(){}
}


Swift FoodGardensAdd DTOs

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

HTTP + OTHER

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

POST /food_gardens HTTP/1.1 
Host: api.sfgtec.com 
Accept: text/jsonl
Content-Type: text/jsonl
Content-Length: length

{"tenantsId":0,"name":"String","description":"String"}
HTTP/1.1 200 OK
Content-Type: text/jsonl
Content-Length: length

{"tenantsId":0,"name":"String","description":"String","responseStatus":{"errorCode":"String","message":"String","stackTrace":"String","errors":[{"errorCode":"String","fieldName":"String","message":"String","meta":{"String":"String"}}],"meta":{"String":"String"}}}