Agentivity API

<back to all web services

GetPassengerLocationsByFlightNumber

The following routes are available for this service:
GET/PassengerLocationsByFlightNumber
import Foundation
import ServiceStack

// @DataContract(Namespace="schemas.agentivity.com/types")
public class GetPassengerLocationsByFlightNumber : CompanyLevelRequestBase
{
    /**
    * Comma Delimited List of Accounts
    */
    // @DataMember
    public var account:[String]

    /**
    * Date in format YYYYMMDD
    */
    // @DataMember
    public var departureDateStart:String

    /**
    * Date in format YYYYMMDD
    */
    // @DataMember
    public var departureDateEnd:String

    /**
    * Two letter code for carrier
    */
    // @DataMember
    public var carrierCode:String

    /**
    * Flight number without spaces
    */
    // @DataMember
    public var flightNumber:String

    /**
    * All future date
    */
    // @DataMember
    public var allFutureDate:Bool

    /**
    * Comma Delimited List of Custom Fields
    */
    // @DataMember
    public var customField:[String]

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

    private enum CodingKeys : String, CodingKey {
        case account
        case departureDateStart
        case departureDateEnd
        case carrierCode
        case flightNumber
        case allFutureDate
        case customField
    }

    required public init(from decoder: Decoder) throws {
        try super.init(from: decoder)
        let container = try decoder.container(keyedBy: CodingKeys.self)
        account = try container.decodeIfPresent([String].self, forKey: .account) ?? []
        departureDateStart = try container.decodeIfPresent(String.self, forKey: .departureDateStart)
        departureDateEnd = try container.decodeIfPresent(String.self, forKey: .departureDateEnd)
        carrierCode = try container.decodeIfPresent(String.self, forKey: .carrierCode)
        flightNumber = try container.decodeIfPresent(String.self, forKey: .flightNumber)
        allFutureDate = try container.decodeIfPresent(Bool.self, forKey: .allFutureDate)
        customField = try container.decodeIfPresent([String].self, forKey: .customField) ?? []
    }

    public override func encode(to encoder: Encoder) throws {
        try super.encode(to: encoder)
        var container = encoder.container(keyedBy: CodingKeys.self)
        if account != nil { try container.encode(account, forKey: .account) }
        if departureDateStart != nil { try container.encode(departureDateStart, forKey: .departureDateStart) }
        if departureDateEnd != nil { try container.encode(departureDateEnd, forKey: .departureDateEnd) }
        if carrierCode != nil { try container.encode(carrierCode, forKey: .carrierCode) }
        if flightNumber != nil { try container.encode(flightNumber, forKey: .flightNumber) }
        if allFutureDate != nil { try container.encode(allFutureDate, forKey: .allFutureDate) }
        if customField != nil { try container.encode(customField, forKey: .customField) }
    }
}

// @DataContract(Namespace="schemas.agentivity.com/types")
public class CompanyLevelRequestBase : PagingMetadata, IMemberUsername, IMemberOwningCompanyCode
{
    /**
    * Comma Delimited List of Owning Company Codes
    */
    // @DataMember
    public var owningCompanyCode:[String]

    /**
    * UserName in form of an email address
    */
    // @DataMember
    public var userName:String

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

    private enum CodingKeys : String, CodingKey {
        case owningCompanyCode
        case userName
    }

    required public init(from decoder: Decoder) throws {
        try super.init(from: decoder)
        let container = try decoder.container(keyedBy: CodingKeys.self)
        owningCompanyCode = try container.decodeIfPresent([String].self, forKey: .owningCompanyCode) ?? []
        userName = try container.decodeIfPresent(String.self, forKey: .userName)
    }

    public override func encode(to encoder: Encoder) throws {
        try super.encode(to: encoder)
        var container = encoder.container(keyedBy: CodingKeys.self)
        if owningCompanyCode != nil { try container.encode(owningCompanyCode, forKey: .owningCompanyCode) }
        if userName != nil { try container.encode(userName, forKey: .userName) }
    }
}

// @DataContract(Name="Metadata", Namespace="schemas.agentivity.com/types")
public class PagingMetadata : Codable
{
    /**
    * Starting Record
    */
    // @DataMember
    // @ApiMember(DataType="string", Description="Starting Record", Name="Offset", ParameterType="query")
    public var offset:String

    /**
    * Number of records to return (PageSize)
    */
    // @DataMember
    // @ApiMember(DataType="string", Description="Number of records to return (PageSize)", Name="Limit", ParameterType="query")
    public var limit:String

    /**
    * Total Number of Records in a Full Reponse (if no paging)
    */
    // @DataMember
    // @ApiMember(DataType="string", Description="Total Number of Records in a Full Reponse (if no paging)", Name="TotalRecords", ParameterType="query")
    public var totalRecords:Int

    /**
    * Total Number of Records in this Reponse (on this page)
    */
    // @DataMember
    // @ApiMember(DataType="string", Description="Total Number of Records in this Reponse (on this page)", Name="ResponseRecords", ParameterType="query")
    public var responseRecords:Int

    required public init(){}
}

// @DataContract(Name="AgentivityResponse", Namespace="schemas.agentivity.com/types")
public class PassengerLocationsByFlightNumberItemResponse : ItemResponse<PassengerLocationFlightNumber, PassengerLocationsByFlightNumberResponseReport>
{
    required public init(){ super.init() }

    required public init(from decoder: Decoder) throws {
        try super.init(from: decoder)
    }

    public override func encode(to encoder: Encoder) throws {
        try super.encode(to: encoder)
    }
}

// @DataContract(Name="AgentivityResponse", Namespace="schemas.agentivity.com/types")
public class ItemResponse<TItem : Codable, TReport : Codable> : Codable
{
    // @DataMember(Order=1)
    public var responseMetadata:ResponseMetadata

    // @DataMember(Order=2, EmitDefaultValue=false)
    public var responseReport:TReport

    // @DataMember(Order=3, EmitDefaultValue=false)
    public var responseError:AgentivityError

    required public init(){}
}

// @DataContract(Name="ResponseMetadata", Namespace="schemas.agentivity.com/types")
public class ResponseMetadata : Codable
{
    // @DataMember(Order=0)
    public var success:Bool

    // @DataMember(Order=1)
    public var hasCache:Bool

    // @DataMember(Order=2)
    public var hasPaging:Bool

    // @DataMember(Order=3, EmitDefaultValue=false)
    public var cacheMetadata:CacheMetadata

    // @DataMember(Order=4, EmitDefaultValue=false)
    public var pagingMetadata:PagingMetadata

    required public init(){}
}

// @DataContract(Name="CacheMetadata", Namespace="schemas.agentivity.com/types")
public class CacheMetadata : Codable
{
    // @DataMember(Order=1)
    public var cachedAt:Date

    // @DataMember(Order=2)
    public var cacheExpiresAt:Date

    // @DataMember(Order=0)
    public var isFromCache:Bool

    required public init(){}
}

// @DataContract(Name="ResponseMetadata", Namespace="schemas.agentivity.com/types")
public class AgentivityError : Codable
{
    // @DataMember
    public var errorCode:String

    // @DataMember
    public var message:String

    // @DataMember
    public var statusCode:String

    // @DataMember
    public var verboseMessage:String

    required public init(){}
}

// @DataContract(Name="PassengerLocationFlightNumber", Namespace="schemas.agentivity.com/types")
public class PassengerLocationFlightNumber : IBookingCustomFields, IBookingIdentifier, ITicketNumbers, IVendorLocators, Codable
{
    // @DataMember(Order=10)
    public var agentivityRef:Int

    // @DataMember(Order=20)
    public var recordLocator:String

    // @DataMember(Order=30)
    public var paxList:String

    // @DataMember(Order=40)
    public var owningConsultantID:String

    // @DataMember(Order=50)
    public var account:String

    // @DataMember(Order=60)
    public var departureDate:Date?

    // @DataMember(Order=70)
    public var boardPoint:String

    // @DataMember(Order=80)
    public var offPoint:String

    // @DataMember(Order=90)
    public var departureTime:String

    // @DataMember(Order=100)
    public var arrivalTime:String

    // @DataMember(Order=110)
    public var changeOfDay:String

    // @DataMember(Order=120)
    public var emailAddress:String

    // @DataMember(Order=130)
    public var phoneNbr:String

    // @DataMember(Order=140)
    public var owningAgencyLocationID:String

    // @DataMember(Order=150)
    public var iataCodes:String

    // @DataMember(Order=160)
    public var customFields:CustomFieldsCollection

    // @DataMember(Order=170)
    public var pnrCreationDate:Date?

    // @DataMember(Order=180)
    public var ticketNumbers:[String]

    // @DataMember(Order=190)
    public var vendorLocators:[BookingExtVendorLocator]

    required public init(){}
}

public class CustomFieldsCollection : List<CustomFieldData>
{
    required public init(){ super.init() }

    required public init(from decoder: Decoder) throws {
        try super.init(from: decoder)
    }

    public override func encode(to encoder: Encoder) throws {
        try super.encode(to: encoder)
    }
}

// @DataContract(Name="CustomField", Namespace="schemas.agentivity.com/types")
public class CustomFieldData : Codable
{
    // @DataMember(Order=20)
    public var fieldName:String

    // @DataMember(Order=30)
    public var fieldValue:String

    required public init(){}
}

// @DataContract(Name="VendorLocator", Namespace="schemas.agentivity.com/types")
public class BookingExtVendorLocator : IBookingIdentifier, Codable
{
    // @DataMember(Order=10)
    public var carrierCode:String

    // @DataMember(Order=20)
    public var vendorLocator:String

    required public init(){}
}

// @DataContract(Name="PassengerLocationFlightNumber", Namespace="schemas.agentivity.com/types")
public class PassengerLocationsByFlightNumberResponseReport : Report<PassengerLocationsByFlightNumberItemResponse, PassengerLocationFlightNumber>
{
    required public init(){ super.init() }

    required public init(from decoder: Decoder) throws {
        try super.init(from: decoder)
    }

    public override func encode(to encoder: Encoder) throws {
        try super.encode(to: encoder)
    }
}

// @DataContract(Namespace="schemas.agentivity.com/types")
public class Report<TItemResponse : Codable, TItem : Codable> : Codable
{
    // @DataMember(Order=1, EmitDefaultValue=false)
    public var item:TItem

    required public init(){}
}


Swift GetPassengerLocationsByFlightNumber 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.

GET /PassengerLocationsByFlightNumber HTTP/1.1 
Host: api.agentivity.com 
Accept: text/jsonl
HTTP/1.1 200 OK
Content-Type: text/jsonl
Content-Length: length

{"ResponseMetadata":{"Success":false,"HasCache":false,"HasPaging":false,"CacheMetadata":{"IsFromCache":false,"CachedAt":"\/Date(-62135596800000-0000)\/","CacheExpiresAt":"\/Date(-62135596800000-0000)\/"},"PagingMetadata":{"Offset":"String","Limit":"String","TotalRecords":0,"ResponseRecords":0}},"ResponseReport":{"Item":{"AgentivityRef":0,"RecordLocator":"String","PaxList":"String","OwningConsultantID":"String","Account":"String","DepartureDate":"\/Date(-62135596800000-0000)\/","BoardPoint":"String","OffPoint":"String","DepartureTime":"String","ArrivalTime":"String","ChangeOfDay":"String","EmailAddress":"String","PhoneNbr":"String","OwningAgencyLocationID":"String","IataCodes":"String","CustomFields":[{"FieldName":"String","FieldValue":"String"}],"PNRCreationDate":"\/Date(-62135596800000-0000)\/","TicketNumbers":["String"],"VendorLocators":[{"CarrierCode":"String","VendorLocator":"String"}]}},"ResponseError":{"ErrorCode":"String","Message":"String","StatusCode":"String","VerboseMessage":"String"}}