| POST | /consumerinitiation |
|---|
Imports System
Imports System.Collections
Imports System.Collections.Generic
Imports System.Runtime.Serialization
Imports ServiceStack
Imports ServiceStack.DataAnnotations
Imports Client_Initiations.ServiceModel
Imports Client_Initiations.ServiceModel.Types
Namespace Global
Namespace Client_Initiations.ServiceModel
Public Enum AddressType
CurrentHome
DestinationHome
CurrentWork
DestinationWork
End Enum
Public Partial Class AssignmentLocationDetails
'''<Summary>
'''Work city
'''</Summary>
<ApiMember(Description:="Work city", IsRequired:=true)>
Public Overridable Property WorkCity As String
'''<Summary>
'''Current work location state
'''</Summary>
<ApiMember(Description:="Current work location state")>
Public Overridable Property CurrentWorkState As String
'''<Summary>
'''Work state or province
'''</Summary>
<ApiMember(Description:="Work state or province")>
Public Overridable Property WorkState As String
'''<Summary>
'''Destination work location state
'''</Summary>
<ApiMember(Description:="Destination work location state")>
Public Overridable Property DestinationWorkState As String
'''<Summary>
'''Work country
'''</Summary>
<ApiMember(Description:="Work country", IsRequired:=true)>
Public Overridable Property WorkCountry As String
'''<Summary>
'''Preferred work location state
'''</Summary>
<ApiMember(Description:="Preferred work location state")>
Public Overridable Property PreferredWorkState As String
'''<Summary>
'''Preferred work location country
'''</Summary>
<ApiMember(Description:="Preferred work location country")>
Public Overridable Property PreferredWorkCountry As String
End Class
'''<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)>
Public Partial Class ConsumerInitiation
Implements IPost
'''<Summary>
'''Client identifier
'''</Summary>
<ApiMember(Description:="Client identifier", IsRequired:=true)>
Public Overridable Property ClientID As String
'''<Summary>
'''Consumer relocation request file details
'''</Summary>
<ApiMember(Description:="Consumer relocation request file details", IsRequired:=true)>
Public Overridable Property File As RelocationsRequestFile
End Class
Public Partial Class ConsumerInitiationResponse
Public Sub New()
Errors = New List(Of ValidateError)
End Sub
'''<Summary>
'''Response message
'''</Summary>
<ApiMember(Description:="Response message")>
Public Overridable Property Message As String
'''<Summary>
'''File identifier for the created initiation
'''</Summary>
<ApiMember(Description:="File identifier for the created initiation")>
Public Overridable Property FileId As String
'''<Summary>
'''List of validation errors, if any
'''</Summary>
<ApiMember(Description:="List of validation errors, if any")>
Public Overridable Property Errors As List(Of ValidateError)
End Class
Public Partial Class RelocationsRequestFile
Public Sub New()
Addresses = New RelocationsRequestFileAddress(){}
Phones = New RelocationsRequestFilePhone(){}
End Sub
'''<Summary>
'''Command type for the request (INITIATE)
'''</Summary>
<ApiMember(Description:="Command type for the request (INITIATE)", IsRequired:=true)>
Public Overridable Property Command As String
'''<Summary>
'''External identifier for the transferee
'''</Summary>
<ApiMember(Description:="External identifier for the transferee", IsRequired:=true)>
Public Overridable Property ExternalID As String
'''<Summary>
'''Details about the transferee
'''</Summary>
<ApiMember(Description:="Details about the transferee", IsRequired:=true)>
Public Overridable Property TransfereeDetails As RelocationsRequestFileTransfereeDetails
'''<Summary>
'''List of addresses associated with the transferee
'''</Summary>
<ApiMember(Description:="List of addresses associated with the transferee", IsRequired:=true)>
Public Overridable Property Addresses As RelocationsRequestFileAddress()
'''<Summary>
'''List of phone numbers associated with the transferee
'''</Summary>
<ApiMember(Description:="List of phone numbers associated with the transferee", IsRequired:=true)>
Public Overridable Property Phones As RelocationsRequestFilePhone()
'''<Summary>
'''Assignment details for the relocation
'''</Summary>
<ApiMember(Description:="Assignment details for the relocation", IsRequired:=true)>
Public Overridable Property AssignmentDetails As RelocationsRequestFileAssignmentDetails
End Class
Public Partial Class RelocationsRequestFileAddress
'''<Summary>
'''Type of address (CurrentHome, DestinationHome, CurrentWork, DestinationWork)
'''</Summary>
<ApiMember(Description:="Type of address (CurrentHome, DestinationHome, CurrentWork, DestinationWork)", IsRequired:=true)>
Public Overridable Property AddressType As AddressType
'''<Summary>
'''Indicates if this is the primary address
'''</Summary>
<ApiMember(Description:="Indicates if this is the primary address", IsRequired:=true)>
Public Overridable Property Primary As YesNo
'''<Summary>
'''Address line 1
'''</Summary>
<ApiMember(Description:="Address line 1", IsRequired:=true)>
Public Overridable Property AddressLine1 As String
'''<Summary>
'''City
'''</Summary>
<ApiMember(Description:="City", IsRequired:=true)>
Public Overridable Property City As String
'''<Summary>
'''Country
'''</Summary>
<ApiMember(Description:="Country", IsRequired:=true)>
Public Overridable Property Country As String
End Class
Public Partial Class RelocationsRequestFileAssignmentDetails
'''<Summary>
'''Program name or code
'''</Summary>
<ApiMember(Description:="Program name or code", IsRequired:=true)>
Public Overridable Property Program As String
'''<Summary>
'''Type of assignment
'''</Summary>
<ApiMember(Description:="Type of assignment", IsRequired:=true)>
Public Overridable Property AssignmentType As String
'''<Summary>
'''Assignment start date
'''</Summary>
<ApiMember(Description:="Assignment start date", IsRequired:=true)>
Public Overridable Property StartDate As Nullable(Of Date)
'''<Summary>
'''Company name
'''</Summary>
<ApiMember(Description:="Company name", IsRequired:=true)>
Public Overridable Property CompanyName As String
'''<Summary>
'''Contact
'''</Summary>
<ApiMember(Description:="Contact", IsRequired:=true)>
Public Overridable Property Contact As String
'''<Summary>
'''Current assignment location details
'''</Summary>
<ApiMember(Description:="Current assignment location details", IsRequired:=true)>
Public Overridable Property Current As AssignmentLocationDetails
'''<Summary>
'''Destination assignment location details
'''</Summary>
<ApiMember(Description:="Destination assignment location details", IsRequired:=true)>
Public Overridable Property Destination As AssignmentLocationDetails
End Class
Public Partial Class RelocationsRequestFilePhone
'''<Summary>
'''Phone type (e.g., Mobile, OriginHome)
'''</Summary>
<ApiMember(Description:="Phone type (e.g., Mobile, OriginHome)", IsRequired:=true)>
Public Overridable Property Type As String
'''<Summary>
'''Indicates if this is the primary phone number
'''</Summary>
<ApiMember(Description:="Indicates if this is the primary phone number", IsRequired:=true)>
Public Overridable Property Primary As YesNo
'''<Summary>
'''Phone number
'''</Summary>
<ApiMember(Description:="Phone number", IsRequired:=true)>
Public Overridable Property Number As String
End Class
Public Partial Class RelocationsRequestFileTransfereeDetails
'''<Summary>
'''First name of the transferee
'''</Summary>
<ApiMember(Description:="First name of the transferee", IsRequired:=true)>
Public Overridable Property FirstName As String
'''<Summary>
'''Last name of the transferee
'''</Summary>
<ApiMember(Description:="Last name of the transferee", IsRequired:=true)>
Public Overridable Property LastName As String
'''<Summary>
'''Preferred email address
'''</Summary>
<ApiMember(Description:="Preferred email address", IsRequired:=true)>
Public Overridable Property PreferredEmail As String
End Class
Public Enum YesNo
Y
N
Item
End Enum
End Namespace
Namespace Client_Initiations.ServiceModel.Types
Public Partial Class ValidateError
Public Overridable Property ErrorNumber As String
Public Overridable Property ErrorDescription As String
End Class
End Namespace
End Namespace
VB.NET ConsumerInitiation DTOs
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>