| POST | /consumerinitiation |
|---|
namespace Client_Initiations.ServiceModel
open System
open System.Collections
open System.Collections.Generic
open System.Runtime.Serialization
open ServiceStack
open ServiceStack.DataAnnotations
[<AllowNullLiteral>]
type ValidateError() =
member val ErrorNumber:String = null with get,set
member val ErrorDescription:String = null with get,set
[<AllowNullLiteral>]
type ConsumerInitiationResponse() =
///<summary>
///Response message
///</summary>
[<ApiMember(Description="Response message")>]
member val Message:String = null with get,set
///<summary>
///File identifier for the created initiation
///</summary>
[<ApiMember(Description="File identifier for the created initiation")>]
member val FileId:String = null with get,set
///<summary>
///List of validation errors, if any
///</summary>
[<ApiMember(Description="List of validation errors, if any")>]
member val Errors:ResizeArray<ValidateError> = new ResizeArray<ValidateError>() with get,set
[<AllowNullLiteral>]
type RelocationsRequestFileTransfereeDetails() =
///<summary>
///First name of the transferee
///</summary>
[<ApiMember(Description="First name of the transferee", IsRequired=true)>]
member val FirstName:String = null with get,set
///<summary>
///Last name of the transferee
///</summary>
[<ApiMember(Description="Last name of the transferee", IsRequired=true)>]
member val LastName:String = null with get,set
///<summary>
///Preferred email address
///</summary>
[<ApiMember(Description="Preferred email address", IsRequired=true)>]
member val PreferredEmail:String = null with get,set
[<AllowNullLiteral>]
type AssignmentLocationDetails() =
///<summary>
///Work city
///</summary>
[<ApiMember(Description="Work city", IsRequired=true)>]
member val WorkCity:String = null with get,set
///<summary>
///Current work location state
///</summary>
[<ApiMember(Description="Current work location state")>]
member val CurrentWorkState:String = null with get,set
///<summary>
///Work state or province
///</summary>
[<ApiMember(Description="Work state or province")>]
member val WorkState:String = null with get,set
///<summary>
///Destination work location state
///</summary>
[<ApiMember(Description="Destination work location state")>]
member val DestinationWorkState:String = null with get,set
///<summary>
///Work country
///</summary>
[<ApiMember(Description="Work country", IsRequired=true)>]
member val WorkCountry:String = null with get,set
///<summary>
///Preferred work location state
///</summary>
[<ApiMember(Description="Preferred work location state")>]
member val PreferredWorkState:String = null with get,set
///<summary>
///Preferred work location country
///</summary>
[<ApiMember(Description="Preferred work location country")>]
member val PreferredWorkCountry:String = null with get,set
[<AllowNullLiteral>]
type RelocationsRequestFileAssignmentDetails() =
///<summary>
///Program name or code
///</summary>
[<ApiMember(Description="Program name or code", IsRequired=true)>]
member val Program:String = null with get,set
///<summary>
///Type of assignment
///</summary>
[<ApiMember(Description="Type of assignment", IsRequired=true)>]
member val AssignmentType:String = null with get,set
///<summary>
///Assignment start date
///</summary>
[<ApiMember(Description="Assignment start date", IsRequired=true)>]
member val StartDate:Nullable<DateTime> = new Nullable<DateTime>() with get,set
///<summary>
///Company name
///</summary>
[<ApiMember(Description="Company name", IsRequired=true)>]
member val CompanyName:String = null with get,set
///<summary>
///Contact
///</summary>
[<ApiMember(Description="Contact", IsRequired=true)>]
member val Contact:String = null with get,set
///<summary>
///Current assignment location details
///</summary>
[<ApiMember(Description="Current assignment location details", IsRequired=true)>]
member val Current:AssignmentLocationDetails = null with get,set
///<summary>
///Destination assignment location details
///</summary>
[<ApiMember(Description="Destination assignment location details", IsRequired=true)>]
member val Destination:AssignmentLocationDetails = null with get,set
[<AllowNullLiteral>]
type RelocationsRequestFile() =
///<summary>
///Command type for the request (INITIATE)
///</summary>
[<ApiMember(Description="Command type for the request (INITIATE)", IsRequired=true)>]
member val Command:String = null with get,set
///<summary>
///External identifier for the transferee
///</summary>
[<ApiMember(Description="External identifier for the transferee", IsRequired=true)>]
member val ExternalID:String = null with get,set
///<summary>
///Details about the transferee
///</summary>
[<ApiMember(Description="Details about the transferee", IsRequired=true)>]
member val TransfereeDetails:RelocationsRequestFileTransfereeDetails = null with get,set
///<summary>
///List of addresses associated with the transferee
///</summary>
[<ApiMember(Description="List of addresses associated with the transferee", IsRequired=true)>]
member val Addresses:RelocationsRequestFileAddress[] = [||] with get,set
///<summary>
///List of phone numbers associated with the transferee
///</summary>
[<ApiMember(Description="List of phone numbers associated with the transferee", IsRequired=true)>]
member val Phones:RelocationsRequestFilePhone[] = [||] with get,set
///<summary>
///Assignment details for the relocation
///</summary>
[<ApiMember(Description="Assignment details for the relocation", IsRequired=true)>]
member val AssignmentDetails:RelocationsRequestFileAssignmentDetails = null with get,set
///<summary>
///Consumer Initiation Service
///</summary>
[<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)>]
[<AllowNullLiteral>]
type ConsumerInitiation() =
interface IPost
///<summary>
///Client identifier
///</summary>
[<ApiMember(Description="Client identifier", IsRequired=true)>]
member val ClientID:String = null with get,set
///<summary>
///Consumer relocation request file details
///</summary>
[<ApiMember(Description="Consumer relocation request file details", IsRequired=true)>]
member val File:RelocationsRequestFile = null with get,set
type AddressType =
| CurrentHome = 0
| DestinationHome = 1
| CurrentWork = 2
| DestinationWork = 3
type YesNo =
| Y = 0
| N = 1
| Item = 2
[<AllowNullLiteral>]
type RelocationsRequestFileAddress() =
///<summary>
///Type of address (CurrentHome, DestinationHome, CurrentWork, DestinationWork)
///</summary>
[<ApiMember(Description="Type of address (CurrentHome, DestinationHome, CurrentWork, DestinationWork)", IsRequired=true)>]
member val AddressType:AddressType = new AddressType() with get,set
///<summary>
///Indicates if this is the primary address
///</summary>
[<ApiMember(Description="Indicates if this is the primary address", IsRequired=true)>]
member val Primary:YesNo = new YesNo() with get,set
///<summary>
///Address line 1
///</summary>
[<ApiMember(Description="Address line 1", IsRequired=true)>]
member val AddressLine1:String = null with get,set
///<summary>
///City
///</summary>
[<ApiMember(Description="City", IsRequired=true)>]
member val City:String = null with get,set
///<summary>
///Country
///</summary>
[<ApiMember(Description="Country", IsRequired=true)>]
member val Country:String = null with get,set
[<AllowNullLiteral>]
type RelocationsRequestFilePhone() =
///<summary>
///Phone type (e.g., Mobile, OriginHome)
///</summary>
[<ApiMember(Description="Phone type (e.g., Mobile, OriginHome)", IsRequired=true)>]
member val Type:String = null with get,set
///<summary>
///Indicates if this is the primary phone number
///</summary>
[<ApiMember(Description="Indicates if this is the primary phone number", IsRequired=true)>]
member val Primary:YesNo = new YesNo() with get,set
///<summary>
///Phone number
///</summary>
[<ApiMember(Description="Phone number", IsRequired=true)>]
member val Number:String = null with get,set
To override the Content-type in your clients, use the HTTP Accept Header, append the .xml suffix or ?format=xml
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/xml
Content-Type: application/xml
Content-Length: length
<ConsumerInitiation xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.datacontract.org/2004/07/Client_Initiations.ServiceModel">
<ClientID>String</ClientID>
<File>
<Addresses>
<RelocationsRequestFileAddress>
<AddressLine1>String</AddressLine1>
<AddressType>CurrentHome</AddressType>
<City>String</City>
<Country>String</Country>
<Primary>Y</Primary>
</RelocationsRequestFileAddress>
</Addresses>
<AssignmentDetails>
<AssignmentType>String</AssignmentType>
<CompanyName>String</CompanyName>
<Contact>String</Contact>
<Current>
<CurrentWorkState>String</CurrentWorkState>
<DestinationWorkState>String</DestinationWorkState>
<PreferredWorkCountry>String</PreferredWorkCountry>
<PreferredWorkState>String</PreferredWorkState>
<WorkCity>String</WorkCity>
<WorkCountry>String</WorkCountry>
<WorkState>String</WorkState>
</Current>
<Destination>
<CurrentWorkState>String</CurrentWorkState>
<DestinationWorkState>String</DestinationWorkState>
<PreferredWorkCountry>String</PreferredWorkCountry>
<PreferredWorkState>String</PreferredWorkState>
<WorkCity>String</WorkCity>
<WorkCountry>String</WorkCountry>
<WorkState>String</WorkState>
</Destination>
<Program>String</Program>
<StartDate>0001-01-01T00:00:00</StartDate>
</AssignmentDetails>
<Command>String</Command>
<ExternalID>String</ExternalID>
<Phones>
<RelocationsRequestFilePhone>
<Number>String</Number>
<Primary>Y</Primary>
<Type>String</Type>
</RelocationsRequestFilePhone>
</Phones>
<TransfereeDetails>
<FirstName>String</FirstName>
<LastName>String</LastName>
<PreferredEmail>String</PreferredEmail>
</TransfereeDetails>
</File>
</ConsumerInitiation>
HTTP/1.1 200 OK
Content-Type: application/xml
Content-Length: length
<ConsumerInitiationResponse xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.datacontract.org/2004/07/Client_Initiations.ServiceModel">
<Errors xmlns:d2p1="http://schemas.datacontract.org/2004/07/Client_Initiations.ServiceModel.Types">
<d2p1:ValidateError>
<d2p1:ErrorDescription>String</d2p1:ErrorDescription>
<d2p1:ErrorNumber>String</d2p1:ErrorNumber>
</d2p1:ValidateError>
</Errors>
<FileId>String</FileId>
<Message>String</Message>
</ConsumerInitiationResponse>