GalaxyMobile App API

<back to all web services

ConfirmOtp

import datetime
import decimal
from marshmallow.fields import *
from servicestack import *
from typing import *
from dataclasses import dataclass, field
from dataclasses_json import dataclass_json, LetterCase, Undefined, config
from enum import Enum, IntEnum


@dataclass_json(letter_case=LetterCase.CAMEL, undefined=Undefined.EXCLUDE)
@dataclass
class ApiServiceRequest(IServiceRequest, IHasApiKey, IHasDeviceInfo, IHasClientId):
    # @ApiMember(DataType="string", Description="The API Key required for authentication", IsRequired=true)
    api_key: Optional[str] = None
    """
    The API Key required for authentication
    """


    # @ApiMember(DataType="double", Description="Latitude of the user making this request")
    latitude: float = 0.0
    """
    Latitude of the user making this request
    """


    # @ApiMember(DataType="double", Description="Longitude of the user making this request")
    longitude: float = 0.0
    """
    Longitude of the user making this request
    """


@dataclass_json(letter_case=LetterCase.CAMEL, undefined=Undefined.EXCLUDE)
@dataclass
class ApiServiceResponse(IServiceResponse):
    description: Optional[str] = None
    heading: Optional[str] = None
    was_successful: bool = False
    model_state: Optional[Object] = None


# @Flags()
class IntegrationProviderType(IntEnum):
    NONE = 0
    EA = 1
    ILLUMINA_HUB_PROTECT_ME = 2
    MY_LEGAL_HAND = 3
    ACCIDENT_ANGELS = 4
    EMERGENCY_SERVICES = 5
    MIGHTY_MOBILE = 6
    PULSIT = 7
    BOLT = 8


@dataclass_json(letter_case=LetterCase.CAMEL, undefined=Undefined.EXCLUDE)
@dataclass
class SystemUserProductAttachmentData:
    id: int = 0
    file_name: Optional[str] = None
    main_file_url: Optional[str] = None
    thumbnail_url: Optional[str] = None
    is_video: bool = False
    is_image: bool = False
    is_pdf: bool = False


@dataclass_json(letter_case=LetterCase.CAMEL, undefined=Undefined.EXCLUDE)
@dataclass
class SystemUserProductData:
    integration_type: Optional[IntegrationProviderType] = None
    product_id: int = 0
    name: Optional[str] = None
    name_afrikaans: Optional[str] = None
    panic_id: int = 0
    user_has_product: bool = False
    can_activate: bool = False
    enquired: bool = False
    dash_image: Optional[str] = None
    show_on_dash: bool = False
    action_url: Optional[str] = None
    attachments: Optional[List[SystemUserProductAttachmentData]] = None
    description_eng: Optional[str] = None
    summary_eng: Optional[str] = None
    description_afr: Optional[str] = None
    summary_afr: Optional[str] = None


@dataclass_json(letter_case=LetterCase.CAMEL, undefined=Undefined.EXCLUDE)
@dataclass
class DependentData:
    dependent_id: int = 0
    first_name: Optional[str] = None
    surname: Optional[str] = None
    mobile_number: Optional[str] = None
    email: Optional[str] = None
    id_number: Optional[str] = None


@dataclass_json(letter_case=LetterCase.CAMEL, undefined=Undefined.EXCLUDE)
@dataclass
class LoginData:
    system_user_id: int = 0
    refresh_token: Optional[str] = None
    first_name: Optional[str] = None
    is_dependent: bool = False
    full_name: Optional[str] = None
    all_products: Optional[List[SystemUserProductData]] = None
    user_products: Optional[List[SystemUserProductData]] = None
    other_products: Optional[List[SystemUserProductData]] = None
    contact_number: Optional[str] = None
    dependents: Optional[List[DependentData]] = None
    unread_message_count: int = 0
    pending_feedback_ids: Optional[List[int]] = None


@dataclass_json(letter_case=LetterCase.CAMEL, undefined=Undefined.EXCLUDE)
@dataclass
class ConfirmOtpResponse(ApiServiceResponse):
    data: Optional[LoginData] = None
    must_set_pin: bool = False


@dataclass_json(letter_case=LetterCase.CAMEL, undefined=Undefined.EXCLUDE)
@dataclass
class ConfirmOtp(ApiServiceRequest):
    system_user_id: int = 0
    otp: Optional[str] = None
    utc_offset: int = 0

Python 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: {}
}