Client_Initiations

<back to all web services

ConsumerInitiation

Consumer Initiation Service

Requires Authentication
The following routes are available for this service:
POST/consumerinitiation
using System;
using System.Collections;
using System.Collections.Generic;
using System.Runtime.Serialization;
using ServiceStack;
using ServiceStack.DataAnnotations;
using Client_Initiations.ServiceModel;
using Client_Initiations.ServiceModel.Types;

namespace Client_Initiations.ServiceModel
{
    public enum AddressType
    {
        CurrentHome,
        DestinationHome,
        CurrentWork,
        DestinationWork,
    }

    public partial class AssignmentLocationDetails
    {
        ///<summary>
        ///Work city
        ///</summary>
        [ApiMember(Description="Work city", IsRequired=true)]
        public virtual string WorkCity { get; set; }

        ///<summary>
        ///Current work location state
        ///</summary>
        [ApiMember(Description="Current work location state")]
        public virtual string CurrentWorkState { get; set; }

        ///<summary>
        ///Work state or province
        ///</summary>
        [ApiMember(Description="Work state or province")]
        public virtual string WorkState { get; set; }

        ///<summary>
        ///Destination work location state
        ///</summary>
        [ApiMember(Description="Destination work location state")]
        public virtual string DestinationWorkState { get; set; }

        ///<summary>
        ///Work country
        ///</summary>
        [ApiMember(Description="Work country", IsRequired=true)]
        public virtual string WorkCountry { get; set; }

        ///<summary>
        ///Preferred work location state
        ///</summary>
        [ApiMember(Description="Preferred work location state")]
        public virtual string PreferredWorkState { get; set; }

        ///<summary>
        ///Preferred work location country
        ///</summary>
        [ApiMember(Description="Preferred work location country")]
        public virtual string PreferredWorkCountry { 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)]
    public partial class ConsumerInitiation
        : IPost
    {
        ///<summary>
        ///Client identifier
        ///</summary>
        [ApiMember(Description="Client identifier", IsRequired=true)]
        public virtual string ClientID { get; set; }

        ///<summary>
        ///Consumer relocation request file details
        ///</summary>
        [ApiMember(Description="Consumer relocation request file details", IsRequired=true)]
        public virtual RelocationsRequestFile File { get; set; }
    }

    public partial class ConsumerInitiationResponse
    {
        public ConsumerInitiationResponse()
        {
            Errors = new List<ValidateError>{};
        }

        ///<summary>
        ///Response message
        ///</summary>
        [ApiMember(Description="Response message")]
        public virtual string Message { get; set; }

        ///<summary>
        ///File identifier for the created initiation
        ///</summary>
        [ApiMember(Description="File identifier for the created initiation")]
        public virtual string FileId { get; set; }

        ///<summary>
        ///List of validation errors, if any
        ///</summary>
        [ApiMember(Description="List of validation errors, if any")]
        public virtual List<ValidateError> Errors { get; set; }
    }

    public partial class RelocationsRequestFile
    {
        public RelocationsRequestFile()
        {
            Addresses = new RelocationsRequestFileAddress[]{};
            Phones = new RelocationsRequestFilePhone[]{};
        }

        ///<summary>
        ///Command type for the request (INITIATE)
        ///</summary>
        [ApiMember(Description="Command type for the request (INITIATE)", IsRequired=true)]
        public virtual string Command { get; set; }

        ///<summary>
        ///External identifier for the transferee
        ///</summary>
        [ApiMember(Description="External identifier for the transferee", IsRequired=true)]
        public virtual string ExternalID { get; set; }

        ///<summary>
        ///Details about the transferee
        ///</summary>
        [ApiMember(Description="Details about the transferee", IsRequired=true)]
        public virtual RelocationsRequestFileTransfereeDetails TransfereeDetails { get; set; }

        ///<summary>
        ///List of addresses associated with the transferee
        ///</summary>
        [ApiMember(Description="List of addresses associated with the transferee", IsRequired=true)]
        public virtual RelocationsRequestFileAddress[] Addresses { get; set; }

        ///<summary>
        ///List of phone numbers associated with the transferee
        ///</summary>
        [ApiMember(Description="List of phone numbers associated with the transferee", IsRequired=true)]
        public virtual RelocationsRequestFilePhone[] Phones { get; set; }

        ///<summary>
        ///Assignment details for the relocation
        ///</summary>
        [ApiMember(Description="Assignment details for the relocation", IsRequired=true)]
        public virtual RelocationsRequestFileAssignmentDetails AssignmentDetails { get; set; }
    }

    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 virtual AddressType AddressType { get; set; }

        ///<summary>
        ///Indicates if this is the primary address
        ///</summary>
        [ApiMember(Description="Indicates if this is the primary address", IsRequired=true)]
        public virtual YesNo Primary { get; set; }

        ///<summary>
        ///Address line 1
        ///</summary>
        [ApiMember(Description="Address line 1", IsRequired=true)]
        public virtual string AddressLine1 { get; set; }

        ///<summary>
        ///City
        ///</summary>
        [ApiMember(Description="City", IsRequired=true)]
        public virtual string City { get; set; }

        ///<summary>
        ///Country
        ///</summary>
        [ApiMember(Description="Country", IsRequired=true)]
        public virtual string Country { get; set; }
    }

    public partial class RelocationsRequestFileAssignmentDetails
    {
        ///<summary>
        ///Program name or code
        ///</summary>
        [ApiMember(Description="Program name or code", IsRequired=true)]
        public virtual string Program { get; set; }

        ///<summary>
        ///Type of assignment
        ///</summary>
        [ApiMember(Description="Type of assignment", IsRequired=true)]
        public virtual string AssignmentType { get; set; }

        ///<summary>
        ///Assignment start date
        ///</summary>
        [ApiMember(Description="Assignment start date", IsRequired=true)]
        public virtual DateTime? StartDate { get; set; }

        ///<summary>
        ///Company name
        ///</summary>
        [ApiMember(Description="Company name", IsRequired=true)]
        public virtual string CompanyName { get; set; }

        ///<summary>
        ///Contact
        ///</summary>
        [ApiMember(Description="Contact", IsRequired=true)]
        public virtual string Contact { get; set; }

        ///<summary>
        ///Current assignment location details
        ///</summary>
        [ApiMember(Description="Current assignment location details", IsRequired=true)]
        public virtual AssignmentLocationDetails Current { get; set; }

        ///<summary>
        ///Destination assignment location details
        ///</summary>
        [ApiMember(Description="Destination assignment location details", IsRequired=true)]
        public virtual AssignmentLocationDetails Destination { get; set; }
    }

    public partial class RelocationsRequestFilePhone
    {
        ///<summary>
        ///Phone type (e.g., Mobile, OriginHome)
        ///</summary>
        [ApiMember(Description="Phone type (e.g., Mobile, OriginHome)", IsRequired=true)]
        public virtual string Type { get; set; }

        ///<summary>
        ///Indicates if this is the primary phone number
        ///</summary>
        [ApiMember(Description="Indicates if this is the primary phone number", IsRequired=true)]
        public virtual YesNo Primary { get; set; }

        ///<summary>
        ///Phone number
        ///</summary>
        [ApiMember(Description="Phone number", IsRequired=true)]
        public virtual string Number { get; set; }
    }

    public partial class RelocationsRequestFileTransfereeDetails
    {
        ///<summary>
        ///First name of the transferee
        ///</summary>
        [ApiMember(Description="First name of the transferee", IsRequired=true)]
        public virtual string FirstName { get; set; }

        ///<summary>
        ///Last name of the transferee
        ///</summary>
        [ApiMember(Description="Last name of the transferee", IsRequired=true)]
        public virtual string LastName { get; set; }

        ///<summary>
        ///Preferred email address
        ///</summary>
        [ApiMember(Description="Preferred email address", IsRequired=true)]
        public virtual string PreferredEmail { get; set; }
    }

    public enum YesNo
    {
        Y,
        N,
        Item,
    }

}

namespace Client_Initiations.ServiceModel.Types
{
    public partial class ValidateError
    {
        public virtual string ErrorNumber { get; set; }
        public virtual string ErrorDescription { get; set; }
    }

}

C# ConsumerInitiation DTOs

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

HTTP + JSV

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: text/jsv
Content-Type: text/jsv
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: 0001-01-01,
			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: text/jsv
Content-Length: length

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