TicketUserServices

<back to all web services

SelfServiceAvailableSeatsRequest

Requires Authentication
The following routes are available for this service:
POST/selfService/transferTicket/availableSeatsSeats a buyer may pick for a seated exchange, grouped by section and row
import Foundation
import ServiceStack

public class SelfServiceAvailableSeatsRequest : Codable
{
    public var ticketTokenId:String?
    public var buyerPhone:String?
    public var toEventId:Int?
    public var toOwnerTicketTypeId:Int?
    public var toSeriesTicketTypeId:Int?

    required public init(){}
}

public class SelfServiceAvailableSeatsResult : SelfServiceTransferResultBase
{
    public var toEventId:Int?
    public var toTicketTypeName:String?
    public var assignedSeatId:Int?
    public var assignedSeatLabel:String?
    public var sections:[SelfServiceSeatSection] = []
    public var totalSeats:Int?
    public var selectableSeats:Int?
    public var truncated:Bool?

    required public init(){ super.init() }

    private enum CodingKeys : String, CodingKey {
        case toEventId
        case toTicketTypeName
        case assignedSeatId
        case assignedSeatLabel
        case sections
        case totalSeats
        case selectableSeats
        case truncated
    }

    required public init(from decoder: Decoder) throws {
        try super.init(from: decoder)
        let container = try decoder.container(keyedBy: CodingKeys.self)
        toEventId = try container.decodeIfPresent(Int.self, forKey: .toEventId)
        toTicketTypeName = try container.decodeIfPresent(String.self, forKey: .toTicketTypeName)
        assignedSeatId = try container.decodeIfPresent(Int.self, forKey: .assignedSeatId)
        assignedSeatLabel = try container.decodeIfPresent(String.self, forKey: .assignedSeatLabel)
        sections = try container.decodeIfPresent([SelfServiceSeatSection].self, forKey: .sections) ?? []
        totalSeats = try container.decodeIfPresent(Int.self, forKey: .totalSeats)
        selectableSeats = try container.decodeIfPresent(Int.self, forKey: .selectableSeats)
        truncated = try container.decodeIfPresent(Bool.self, forKey: .truncated)
    }

    public override func encode(to encoder: Encoder) throws {
        try super.encode(to: encoder)
        var container = encoder.container(keyedBy: CodingKeys.self)
        if toEventId != nil { try container.encode(toEventId, forKey: .toEventId) }
        if toTicketTypeName != nil { try container.encode(toTicketTypeName, forKey: .toTicketTypeName) }
        if assignedSeatId != nil { try container.encode(assignedSeatId, forKey: .assignedSeatId) }
        if assignedSeatLabel != nil { try container.encode(assignedSeatLabel, forKey: .assignedSeatLabel) }
        if sections.count > 0 { try container.encode(sections, forKey: .sections) }
        if totalSeats != nil { try container.encode(totalSeats, forKey: .totalSeats) }
        if selectableSeats != nil { try container.encode(selectableSeats, forKey: .selectableSeats) }
        if truncated != nil { try container.encode(truncated, forKey: .truncated) }
    }
}

public class SelfServiceTransferResultBase : Codable
{
    public var ok:Bool?
    public var statusCode:Int?
    public var code:String?
    public var message:String?

    required public init(){}
}

public class SelfServiceSeatSection : Codable
{
    public var sectionId:Int?
    public var sectionName:String?
    public var positionX:Double?
    public var positionY:Double?
    public var rotation:Double?
    public var viewType:String?
    public var seats:[SelfServiceSeatOption] = []

    required public init(){}
}

public class SelfServiceSeatOption : Codable
{
    public var seatId:Int?
    public var seatName:String?
    public var label:String?
    public var status:String?
    public var isSeat:Bool?
    public var selectable:Bool?
    public var positionX:Double?
    public var positionY:Double?
    public var rotation:Double?
    public var sortOrder:Double?
    public var rowId:Int?
    public var rowName:String?

    required public init(){}
}


Swift SelfServiceAvailableSeatsRequest DTOs

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

To embed the response in a jsonp callback, append ?callback=myCallback

HTTP + JSON

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

POST /selfService/transferTicket/availableSeats HTTP/1.1 
Host: stubbur-app.azurewebsites.net 
Accept: application/json
Content-Type: application/json
Content-Length: length

{"ticketTokenId":"String","buyerPhone":"String","toEventId":0,"toOwnerTicketTypeId":0,"toSeriesTicketTypeId":0}
HTTP/1.1 200 OK
Content-Type: application/json
Content-Length: length

{"toEventId":0,"toTicketTypeName":"String","assignedSeatId":0,"assignedSeatLabel":"String","sections":[{"sectionId":0,"sectionName":"String","positionX":0,"positionY":0,"rotation":0,"viewType":"String","seats":[{"seatId":0,"seatName":"String","label":"String","status":"String","isSeat":false,"selectable":false,"positionX":0,"positionY":0,"rotation":0,"sortOrder":0,"rowId":0,"rowName":"String"}]}],"totalSeats":0,"selectableSeats":0,"truncated":false,"ok":false,"statusCode":0,"code":"String","message":"String"}