Client_Initiations

<back to all web services

ConsumerInitiation

Consumer Initiation Service

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

/**
* Consumer Initiation Service
*/
// @Api(Description="Consumer Initiation Service")
// @ApiResponse(Description="Returned when the consumer initiation was successfully processed", StatusCode=200)
// @ApiResponse(Description="Returned if the request validation failed", StatusCode=400)
// @ApiResponse(Description="Returned if the client is not authorized", StatusCode=401)
// @ApiResponse(Description="Returned if an error occurred while processing the request", StatusCode=500)
public class ConsumerInitiation : IPost, Codable
{
    /**
    * Client identifier
    */
    // @ApiMember(Description="Client identifier", IsRequired=true)
    public var clientID:String

    /**
    * Consumer relocation request file details
    */
    // @ApiMember(Description="Consumer relocation request file details", IsRequired=true)
    public var file:RelocationsRequestFile

    required public init(){}
}

public class RelocationsRequestFile : Codable
{
    /**
    * Command type for the request (INITIATE)
    */
    // @ApiMember(Description="Command type for the request (INITIATE)", IsRequired=true)
    public var command:String

    /**
    * External identifier for the transferee
    */
    // @ApiMember(Description="External identifier for the transferee", IsRequired=true)
    public var externalID:String

    /**
    * Details about the transferee
    */
    // @ApiMember(Description="Details about the transferee", IsRequired=true)
    public var transfereeDetails:RelocationsRequestFileTransfereeDetails

    /**
    * List of addresses associated with the transferee
    */
    // @ApiMember(Description="List of addresses associated with the transferee", IsRequired=true)
    public var addresses:[RelocationsRequestFileAddress] = []

    /**
    * List of phone numbers associated with the transferee
    */
    // @ApiMember(Description="List of phone numbers associated with the transferee", IsRequired=true)
    public var phones:[RelocationsRequestFilePhone] = []

    /**
    * Assignment details for the relocation
    */
    // @ApiMember(Description="Assignment details for the relocation", IsRequired=true)
    public var assignmentDetails:RelocationsRequestFileAssignmentDetails

    required public init(){}
}

public class RelocationsRequestFileTransfereeDetails : Codable
{
    /**
    * First name of the transferee
    */
    // @ApiMember(Description="First name of the transferee", IsRequired=true)
    public var firstName:String

    /**
    * Last name of the transferee
    */
    // @ApiMember(Description="Last name of the transferee", IsRequired=true)
    public var lastName:String

    /**
    * Preferred email address
    */
    // @ApiMember(Description="Preferred email address", IsRequired=true)
    public var preferredEmail:String

    required public init(){}
}

public class RelocationsRequestFileAddress : Codable
{
    /**
    * Type of address (CurrentHome, DestinationHome, CurrentWork, DestinationWork)
    */
    // @ApiMember(Description="Type of address (CurrentHome, DestinationHome, CurrentWork, DestinationWork)", IsRequired=true)
    public var addressType:AddressType

    /**
    * Indicates if this is the primary address
    */
    // @ApiMember(Description="Indicates if this is the primary address", IsRequired=true)
    public var primary:YesNo

    /**
    * Address line 1
    */
    // @ApiMember(Description="Address line 1", IsRequired=true)
    public var addressLine1:String

    /**
    * City
    */
    // @ApiMember(Description="City", IsRequired=true)
    public var city:String

    /**
    * Country
    */
    // @ApiMember(Description="Country", IsRequired=true)
    public var country:String

    required public init(){}
}

public enum AddressType : String, Codable
{
    case CurrentHome
    case DestinationHome
    case CurrentWork
    case DestinationWork
}

public enum YesNo : String, Codable
{
    case Y
    case N
    case Item
}

public class RelocationsRequestFilePhone : Codable
{
    /**
    * Phone type (e.g., Mobile, OriginHome)
    */
    // @ApiMember(Description="Phone type (e.g., Mobile, OriginHome)", IsRequired=true)
    public var type:String

    /**
    * Indicates if this is the primary phone number
    */
    // @ApiMember(Description="Indicates if this is the primary phone number", IsRequired=true)
    public var primary:YesNo

    /**
    * Phone number
    */
    // @ApiMember(Description="Phone number", IsRequired=true)
    public var number:String

    required public init(){}
}

public class RelocationsRequestFileAssignmentDetails : Codable
{
    /**
    * Program name or code
    */
    // @ApiMember(Description="Program name or code", IsRequired=true)
    public var program:String

    /**
    * Type of assignment
    */
    // @ApiMember(Description="Type of assignment", IsRequired=true)
    public var assignmentType:String

    /**
    * Assignment start date
    */
    // @ApiMember(Description="Assignment start date", IsRequired=true)
    public var startDate:Date?

    /**
    * Company name
    */
    // @ApiMember(Description="Company name", IsRequired=true)
    public var companyName:String

    /**
    * Contact
    */
    // @ApiMember(Description="Contact", IsRequired=true)
    public var contact:String

    /**
    * Current assignment location details
    */
    // @ApiMember(Description="Current assignment location details", IsRequired=true)
    public var current:AssignmentLocationDetails

    /**
    * Destination assignment location details
    */
    // @ApiMember(Description="Destination assignment location details", IsRequired=true)
    public var destination:AssignmentLocationDetails

    required public init(){}
}

public class AssignmentLocationDetails : Codable
{
    /**
    * Work city
    */
    // @ApiMember(Description="Work city", IsRequired=true)
    public var workCity:String

    /**
    * Current work location state
    */
    // @ApiMember(Description="Current work location state")
    public var currentWorkState:String

    /**
    * Work state or province
    */
    // @ApiMember(Description="Work state or province")
    public var workState:String

    /**
    * Destination work location state
    */
    // @ApiMember(Description="Destination work location state")
    public var destinationWorkState:String

    /**
    * Work country
    */
    // @ApiMember(Description="Work country", IsRequired=true)
    public var workCountry:String

    /**
    * Preferred work location state
    */
    // @ApiMember(Description="Preferred work location state")
    public var preferredWorkState:String

    /**
    * Preferred work location country
    */
    // @ApiMember(Description="Preferred work location country")
    public var preferredWorkCountry:String

    required public init(){}
}

public class ConsumerInitiationResponse : Codable
{
    /**
    * Response message
    */
    // @ApiMember(Description="Response message")
    public var message:String

    /**
    * File identifier for the created initiation
    */
    // @ApiMember(Description="File identifier for the created initiation")
    public var fileId:String

    /**
    * List of validation errors, if any
    */
    // @ApiMember(Description="List of validation errors, if any")
    public var errors:[ValidateError] = []

    required public init(){}
}

public class ValidateError : Codable
{
    public var errorNumber:String
    public var errorDescription:String

    required public init(){}
}


Swift ConsumerInitiation 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 /consumerinitiation HTTP/1.1 
Host: initiation-pen.sirva.com 
Accept: application/json
Content-Type: application/json
Content-Length: length

{"ClientID":"String","File":{"Command":"String","ExternalID":"String","TransfereeDetails":{"FirstName":"String","LastName":"String","PreferredEmail":"String"},"Addresses":[{"AddressType":"CurrentHome","Primary":"Y","AddressLine1":"String","City":"String","Country":"String"}],"Phones":[{"Type":"String","Primary":"Y","Number":"String"}],"AssignmentDetails":{"Program":"String","AssignmentType":"String","StartDate":"\/Date(-62135596800000-0000)\/","CompanyName":"String","Contact":"String","Current":{"WorkCity":"String","CurrentWorkState":"String","WorkState":"String","DestinationWorkState":"String","WorkCountry":"String","PreferredWorkState":"String","PreferredWorkCountry":"String"},"Destination":{"WorkCity":"String","CurrentWorkState":"String","WorkState":"String","DestinationWorkState":"String","WorkCountry":"String","PreferredWorkState":"String","PreferredWorkCountry":"String"}}}}
HTTP/1.1 200 OK
Content-Type: application/json
Content-Length: length

{"Message":"String","FileId":"String","Errors":[{"ErrorNumber":"String","ErrorDescription":"String"}]}