GalaxyMobile App API

<back to all web services

ConfirmOtp

import Foundation
import ServiceStack

public class ConfirmOtp : ApiServiceRequest
{
    public var systemUserId:Int
    public var otp:String
    public var utcOffset:Int

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

    private enum CodingKeys : String, CodingKey {
        case systemUserId
        case otp
        case utcOffset
    }

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

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

public class ApiServiceRequest : IServiceRequest, IHasApiKey, IHasDeviceInfo, IHasClientId, Codable
{
    /**
    * The API Key required for authentication
    */
    // @ApiMember(DataType="string", Description="The API Key required for authentication", IsRequired=true)
    public var apiKey:String

    /**
    * Latitude of the user making this request
    */
    // @ApiMember(DataType="double", Description="Latitude of the user making this request")
    public var latitude:Double

    /**
    * Longitude of the user making this request
    */
    // @ApiMember(DataType="double", Description="Longitude of the user making this request")
    public var longitude:Double

    required public init(){}
}

public class ConfirmOtpResponse : ApiServiceResponse
{
    public var data:LoginData
    public var mustSetPin:Bool

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

    private enum CodingKeys : String, CodingKey {
        case data
        case mustSetPin
    }

    required public init(from decoder: Decoder) throws {
        try super.init(from: decoder)
        let container = try decoder.container(keyedBy: CodingKeys.self)
        data = try container.decodeIfPresent(LoginData.self, forKey: .data)
        mustSetPin = try container.decodeIfPresent(Bool.self, forKey: .mustSetPin)
    }

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

public class ApiServiceResponse : IServiceResponse, Codable
{
    public var Description:String
    public var heading:String
    public var wasSuccessful:Bool
    //modelState:Object ignored. Type could not be extended in Swift

    required public init(){}
}

public class LoginData : Codable
{
    public var systemUserId:Int
    public var refreshToken:String
    public var firstName:String
    public var isDependent:Bool
    public var fullName:String
    public var allProducts:[SystemUserProductData] = []
    public var userProducts:[SystemUserProductData] = []
    public var otherProducts:[SystemUserProductData] = []
    public var contactNumber:String
    public var dependents:[DependentData] = []
    public var unreadMessageCount:Int
    public var pendingFeedbackIds:[Int] = []

    required public init(){}
}

public class SystemUserProductData : Codable
{
    public var integrationType:IntegrationProviderType
    public var productId:Int
    public var name:String
    public var nameAfrikaans:String
    public var panicId:Int
    public var userHasProduct:Bool
    public var canActivate:Bool
    public var enquired:Bool
    public var dashImage:String
    public var showOnDash:Bool
    public var actionUrl:String
    public var attachments:[SystemUserProductAttachmentData] = []
    public var descriptionEng:String
    public var summaryEng:String
    public var descriptionAfr:String
    public var summaryAfr:String

    required public init(){}
}

// @Flags()
public enum IntegrationProviderType : Int, Codable
{
    case None = 0
    case EA = 1
    case IlluminaHubProtectMe = 2
    case MyLegalHand = 3
    case AccidentAngels = 4
    case EmergencyServices = 5
    case MightyMobile = 6
    case Pulsit = 7
    case Bolt = 8
}

public class SystemUserProductAttachmentData : Codable
{
    public var id:Int
    public var fileName:String
    public var mainFileUrl:String
    public var thumbnailUrl:String
    public var isVideo:Bool
    public var isImage:Bool
    public var isPdf:Bool

    required public init(){}
}

public class DependentData : Codable
{
    public var dependentId:Int
    public var firstName:String
    public var surname:String
    public var mobileNumber:String
    public var email:String
    public var idNumber:String

    required public init(){}
}


Swift ConfirmOtp 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 /jsv/reply/ConfirmOtp HTTP/1.1 
Host: galaxymobile.api.dev.86degrees.com 
Accept: text/jsv
Content-Type: text/jsv
Content-Length: length

{
	SystemUserId: 0,
	Otp: String,
	UtcOffset: 0,
	ApiKey: String,
	Latitude: 0,
	Longitude: 0
}
HTTP/1.1 200 OK
Content-Type: text/jsv
Content-Length: length

{
	Data: 
	{
		SystemUserId: 0,
		RefreshToken: String,
		FirstName: String,
		IsDependent: False,
		FullName: String,
		AllProducts: 
		[
			{
				IntegrationType: 0,
				ProductId: 0,
				Name: String,
				NameAfrikaans: String,
				PanicId: 0,
				UserHasProduct: False,
				CanActivate: False,
				Enquired: False,
				DashImage: String,
				ShowOnDash: False,
				ActionUrl: String,
				Attachments: 
				[
					{
						Id: 0,
						FileName: String,
						MainFileUrl: String,
						ThumbnailUrl: String,
						IsVideo: False,
						IsImage: False,
						IsPdf: False
					}
				],
				DescriptionEng: String,
				SummaryEng: String,
				DescriptionAfr: String,
				SummaryAfr: String
			}
		],
		UserProducts: 
		[
			{
				IntegrationType: 0,
				ProductId: 0,
				Name: String,
				NameAfrikaans: String,
				PanicId: 0,
				UserHasProduct: False,
				CanActivate: False,
				Enquired: False,
				DashImage: String,
				ShowOnDash: False,
				ActionUrl: String,
				Attachments: 
				[
					{
						Id: 0,
						FileName: String,
						MainFileUrl: String,
						ThumbnailUrl: String,
						IsVideo: False,
						IsImage: False,
						IsPdf: False
					}
				],
				DescriptionEng: String,
				SummaryEng: String,
				DescriptionAfr: String,
				SummaryAfr: String
			}
		],
		OtherProducts: 
		[
			{
				IntegrationType: 0,
				ProductId: 0,
				Name: String,
				NameAfrikaans: String,
				PanicId: 0,
				UserHasProduct: False,
				CanActivate: False,
				Enquired: False,
				DashImage: String,
				ShowOnDash: False,
				ActionUrl: String,
				Attachments: 
				[
					{
						Id: 0,
						FileName: String,
						MainFileUrl: String,
						ThumbnailUrl: String,
						IsVideo: False,
						IsImage: False,
						IsPdf: False
					}
				],
				DescriptionEng: String,
				SummaryEng: String,
				DescriptionAfr: String,
				SummaryAfr: String
			}
		],
		ContactNumber: String,
		Dependents: 
		[
			{
				DependentId: 0,
				FirstName: String,
				Surname: String,
				MobileNumber: String,
				Email: String,
				IdNumber: String
			}
		],
		UnreadMessageCount: 0,
		PendingFeedbackIds: 
		[
			0
		]
	},
	MustSetPin: False,
	Description: String,
	Heading: String,
	WasSuccessful: False,
	ModelState: {}
}