AIM Web Services

<back to all web services

C2BGetDistrictInfoRequest

C2BGetDistrictInfo
Requires active-e Contracts Service.

The following routes are available for this service:
POST, GET/api/C2BGetDistrictInfo
import Foundation
import ServiceStack

/**
* C2BGetDistrictInfoRequires active-e Contracts Service.
*/
// @DataContract
public class C2BGetDistrictInfoRequest : BaseRequest
{
    /**
    * If sent, only districts with schools of the sent plan code will be returned.
    */
    // @DataMember
    // @ApiMember(DataType="string", Description="If sent, only districts with schools of the sent plan code will be returned.", Format="date", Name="PlanCode", ParameterType="query")
    public var planCode:String

    /**
    * ID of the Instrument record. Optional.
    */
    // @DataMember
    // @ApiMember(DataType="integer", Description="ID of the Instrument record. Optional.", Format="int64", Name="RinPk", ParameterType="query")
    public var rinPk:Int?

    /**
    * Optional Request Type. Valid values are Contract and Shipping.
    */
    // @DataMember
    // @ApiMember(DataType="string", Description="Optional Request Type. Valid values are Contract and Shipping.", Name="RequestType", ParameterType="query")
    public var requestType:String

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

    private enum CodingKeys : String, CodingKey {
        case planCode
        case rinPk
        case requestType
    }

    required public init(from decoder: Decoder) throws {
        try super.init(from: decoder)
        let container = try decoder.container(keyedBy: CodingKeys.self)
        planCode = try container.decodeIfPresent(String.self, forKey: .planCode)
        rinPk = try container.decodeIfPresent(Int.self, forKey: .rinPk)
        requestType = try container.decodeIfPresent(String.self, forKey: .requestType)
    }

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

// @DataContract
public class BaseRequest : Codable
{
    /**
    * This is your AIM API Key provided by Tri-Tech
    */
    // @DataMember
    // @ApiMember(DataType="string", Description="This is your AIM API Key provided by Tri-Tech", IsRequired=true, Name="ApiKey", ParameterType="header")
    public var apiKey:String

    // @DataMember
    // @ApiMember(DataType="string", Name="OAuthToken", ParameterType="header")
    public var oAuthToken:String

    required public init(){}
}

// @DataContract
public class C2BGetDistrictInfoResponse : BaseResponse
{
    // @DataMember
    public var districts:[C2BDistrictGeneric] = []

    // @DataMember
    public var teacherTableExists:Bool

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

    private enum CodingKeys : String, CodingKey {
        case districts
        case teacherTableExists
    }

    required public init(from decoder: Decoder) throws {
        try super.init(from: decoder)
        let container = try decoder.container(keyedBy: CodingKeys.self)
        districts = try container.decodeIfPresent([C2BDistrictGeneric].self, forKey: .districts) ?? []
        teacherTableExists = try container.decodeIfPresent(Bool.self, forKey: .teacherTableExists)
    }

    public override func encode(to encoder: Encoder) throws {
        try super.encode(to: encoder)
        var container = encoder.container(keyedBy: CodingKeys.self)
        if districts.count > 0 { try container.encode(districts, forKey: .districts) }
        if teacherTableExists != nil { try container.encode(teacherTableExists, forKey: .teacherTableExists) }
    }
}

// @DataContract
public class BaseResponse : Codable
{
    /**
    * 
    */
    // @DataMember
    // @ApiMember(DataType="BaseResponseResult", Description="", Name="Status", ParameterType="body")
    public var status:BaseResponseResult

    required public init(){}
}

// @DataContract
public class BaseResponseResult : Codable
{
    /**
    * 
    */
    // @DataMember
    // @ApiMember(DataType="string", Description="", Name="StatusCode", ParameterType="body")
    public var statusCode:String

    /**
    * 
    */
    // @DataMember
    // @ApiMember(DataType="string", Description="", Name="Login", ParameterType="body")
    public var login:String

    /**
    * 
    */
    // @DataMember
    // @ApiMember(DataType="string", Description="", Name="ErrorCode", ParameterType="body")
    public var errorCode:String

    /**
    * 
    */
    // @DataMember
    // @ApiMember(DataType="string", Description="", Name="ErrorDisplayText", ParameterType="body")
    public var errorDisplayText:String

    /**
    * 
    */
    // @DataMember
    // @ApiMember(DataType="string", Description="", Name="ErrorMessage", ParameterType="body")
    public var errorMessage:String

    /**
    * 
    */
    // @DataMember
    // @ApiMember(DataType="string", Description="", ExcludeInSchema=true, Name="DomainName", ParameterType="body")
    public var domainName:String

    /**
    * 
    */
    // @DataMember
    // @ApiMember(DataType="string", Description="", ExcludeInSchema=true, Name="IPAddress", ParameterType="body")
    public var ipAddress:String

    required public init(){}
}

// @DataContract
public class C2BDistrictGeneric : Codable
{
    // @DataMember
    public var districtName:String

    // @DataMember
    public var schoolCount:Int

    // @DataMember
    public var teacherCount:Int

    // @DataMember
    public var topic:String

    // @DataMember
    public var id:Int

    required public init(){}
}


Swift C2BGetDistrictInfoRequest DTOs

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

HTTP + XML

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

POST /api/C2BGetDistrictInfo HTTP/1.1 
Host: active-ewebservice.biz 
Accept: application/xml
Content-Type: application/xml
Content-Length: length

<C2BGetDistrictInfoRequest xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.datacontract.org/2004/07/AIM.WebService">
  <ApiKey>String</ApiKey>
  <OAuthToken>String</OAuthToken>
  <PlanCode>String</PlanCode>
  <RequestType>String</RequestType>
  <RinPk>0</RinPk>
</C2BGetDistrictInfoRequest>
HTTP/1.1 200 OK
Content-Type: application/xml
Content-Length: length

<C2BGetDistrictInfoResponse xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.datacontract.org/2004/07/AIM.WebService">
  <Status>
    <DomainName>String</DomainName>
    <ErrorCode>String</ErrorCode>
    <ErrorDisplayText>String</ErrorDisplayText>
    <ErrorMessage>String</ErrorMessage>
    <IpAddress>String</IpAddress>
    <Login>String</Login>
    <StatusCode>String</StatusCode>
  </Status>
  <Districts xmlns:d2p1="http://schemas.datacontract.org/2004/07/AIM">
    <d2p1:C2BDistrictGeneric i:nil="true" />
  </Districts>
  <TeacherTableExists>false</TeacherTableExists>
</C2BGetDistrictInfoResponse>