GalaxyMobile Client API

<back to all web services

UserLoginRequest

The following routes are available for this service:
POST/user/loginCheck that the user exists on Galaxy and set up their account and services.
<?php namespace dtos;

use DateTime;
use Exception;
use DateInterval;
use JsonSerializable;
use ServiceStack\{IReturn,IReturnVoid,IGet,IPost,IPut,IDelete,IPatch,IMeta,IHasSessionId,IHasBearerToken,IHasVersion};
use ServiceStack\{ICrud,ICreateDb,IUpdateDb,IPatchDb,IDeleteDb,ISaveDb,AuditBase,QueryDb,QueryDb2,QueryData,QueryData2,QueryResponse};
use ServiceStack\{ResponseStatus,ResponseError,EmptyResponse,IdResponse,ArrayList,KeyValuePair2,StringResponse,StringsResponse,Tuple2,Tuple3,ByteArray};
use ServiceStack\{JsonConverters,Returns,TypeContext};


class ApiServiceRequest implements IServiceRequest, IHasApiKey, JsonSerializable
{
    public function __construct(
        /** @description The API Key required for authentication */
        // @ApiMember(DataType="string", Description="The API Key required for authentication", IsRequired=true)
        /** @var string */
        public string $ApiKey=''
    ) {
    }

    /** @throws Exception */
    public function fromMap($o): void {
        if (isset($o['ApiKey'])) $this->ApiKey = $o['ApiKey'];
    }
    
    /** @throws Exception */
    public function jsonSerialize(): mixed
    {
        $o = [];
        if (isset($this->ApiKey)) $o['ApiKey'] = $this->ApiKey;
        return empty($o) ? new class(){} : $o;
    }
}

class ApiServiceResponse implements IServiceResponse, JsonSerializable
{
    public function __construct(
        /** @var string|null */
        public ?string $Description=null,
        /** @var string|null */
        public ?string $Heading=null,
        /** @var bool|null */
        public ?bool $WasSuccessful=null,
        /** @var Object|null */
        public ?Object $ModelState=null
    ) {
    }

    /** @throws Exception */
    public function fromMap($o): void {
        if (isset($o['Description'])) $this->Description = $o['Description'];
        if (isset($o['Heading'])) $this->Heading = $o['Heading'];
        if (isset($o['WasSuccessful'])) $this->WasSuccessful = $o['WasSuccessful'];
        if (isset($o['ModelState'])) $this->ModelState = JsonConverters::from('Object', $o['ModelState']);
    }
    
    /** @throws Exception */
    public function jsonSerialize(): mixed
    {
        $o = [];
        if (isset($this->Description)) $o['Description'] = $this->Description;
        if (isset($this->Heading)) $o['Heading'] = $this->Heading;
        if (isset($this->WasSuccessful)) $o['WasSuccessful'] = $this->WasSuccessful;
        if (isset($this->ModelState)) $o['ModelState'] = JsonConverters::to('Object', $this->ModelState);
        return empty($o) ? new class(){} : $o;
    }
}

enum IntegrationProviderType : int
{
    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;
}

class UserProductAttachmentData implements JsonSerializable
{
    public function __construct(
        /** @var string|null */
        public ?string $FileName=null,
        /** @var string|null */
        public ?string $MainFileUrl=null,
        /** @var string|null */
        public ?string $ThumbnailUrl=null,
        /** @var bool|null */
        public ?bool $IsVideo=null,
        /** @var bool|null */
        public ?bool $IsImage=null,
        /** @var bool|null */
        public ?bool $IsPdf=null
    ) {
    }

    /** @throws Exception */
    public function fromMap($o): void {
        if (isset($o['FileName'])) $this->FileName = $o['FileName'];
        if (isset($o['MainFileUrl'])) $this->MainFileUrl = $o['MainFileUrl'];
        if (isset($o['ThumbnailUrl'])) $this->ThumbnailUrl = $o['ThumbnailUrl'];
        if (isset($o['IsVideo'])) $this->IsVideo = $o['IsVideo'];
        if (isset($o['IsImage'])) $this->IsImage = $o['IsImage'];
        if (isset($o['IsPdf'])) $this->IsPdf = $o['IsPdf'];
    }
    
    /** @throws Exception */
    public function jsonSerialize(): mixed
    {
        $o = [];
        if (isset($this->FileName)) $o['FileName'] = $this->FileName;
        if (isset($this->MainFileUrl)) $o['MainFileUrl'] = $this->MainFileUrl;
        if (isset($this->ThumbnailUrl)) $o['ThumbnailUrl'] = $this->ThumbnailUrl;
        if (isset($this->IsVideo)) $o['IsVideo'] = $this->IsVideo;
        if (isset($this->IsImage)) $o['IsImage'] = $this->IsImage;
        if (isset($this->IsPdf)) $o['IsPdf'] = $this->IsPdf;
        return empty($o) ? new class(){} : $o;
    }
}

class UserProductData implements JsonSerializable
{
    public function __construct(
        /** @var IntegrationProviderType|null */
        public ?IntegrationProviderType $IntegrationType=null,
        /** @var int */
        public int $ProductId=0,
        /** @var string|null */
        public ?string $Name=null,
        /** @var string|null */
        public ?string $NameAfrikaans=null,
        /** @var string|null */
        public ?string $DashImageUrl=null,
        /** @var string|null */
        public ?string $ActionUrl=null,
        /** @var array<UserProductAttachmentData>|null */
        public ?array $Attachments=null,
        /** @var string|null */
        public ?string $DescriptionEng=null,
        /** @var string|null */
        public ?string $SummaryEng=null,
        /** @var string|null */
        public ?string $DescriptionAfr=null,
        /** @var string|null */
        public ?string $SummaryAfr=null
    ) {
    }

    /** @throws Exception */
    public function fromMap($o): void {
        if (isset($o['IntegrationType'])) $this->IntegrationType = JsonConverters::from('IntegrationProviderType', $o['IntegrationType']);
        if (isset($o['ProductId'])) $this->ProductId = $o['ProductId'];
        if (isset($o['Name'])) $this->Name = $o['Name'];
        if (isset($o['NameAfrikaans'])) $this->NameAfrikaans = $o['NameAfrikaans'];
        if (isset($o['DashImageUrl'])) $this->DashImageUrl = $o['DashImageUrl'];
        if (isset($o['ActionUrl'])) $this->ActionUrl = $o['ActionUrl'];
        if (isset($o['Attachments'])) $this->Attachments = JsonConverters::fromArray('UserProductAttachmentData', $o['Attachments']);
        if (isset($o['DescriptionEng'])) $this->DescriptionEng = $o['DescriptionEng'];
        if (isset($o['SummaryEng'])) $this->SummaryEng = $o['SummaryEng'];
        if (isset($o['DescriptionAfr'])) $this->DescriptionAfr = $o['DescriptionAfr'];
        if (isset($o['SummaryAfr'])) $this->SummaryAfr = $o['SummaryAfr'];
    }
    
    /** @throws Exception */
    public function jsonSerialize(): mixed
    {
        $o = [];
        if (isset($this->IntegrationType)) $o['IntegrationType'] = JsonConverters::to('IntegrationProviderType', $this->IntegrationType);
        if (isset($this->ProductId)) $o['ProductId'] = $this->ProductId;
        if (isset($this->Name)) $o['Name'] = $this->Name;
        if (isset($this->NameAfrikaans)) $o['NameAfrikaans'] = $this->NameAfrikaans;
        if (isset($this->DashImageUrl)) $o['DashImageUrl'] = $this->DashImageUrl;
        if (isset($this->ActionUrl)) $o['ActionUrl'] = $this->ActionUrl;
        if (isset($this->Attachments)) $o['Attachments'] = JsonConverters::toArray('UserProductAttachmentData', $this->Attachments);
        if (isset($this->DescriptionEng)) $o['DescriptionEng'] = $this->DescriptionEng;
        if (isset($this->SummaryEng)) $o['SummaryEng'] = $this->SummaryEng;
        if (isset($this->DescriptionAfr)) $o['DescriptionAfr'] = $this->DescriptionAfr;
        if (isset($this->SummaryAfr)) $o['SummaryAfr'] = $this->SummaryAfr;
        return empty($o) ? new class(){} : $o;
    }
}

class DependentData implements JsonSerializable
{
    public function __construct(
        /** @description Dependent's Galaxy Id used for referring to or deleting. */
        // @ApiMember(Description="Dependent's Galaxy Id used for referring to or deleting.", IsRequired=true)
        /** @var int */
        public int $DependentId=0,

        /** @description Dependent's first name. */
        // @ApiMember(Description="Dependent's first name.", IsRequired=true)
        /** @var string */
        public string $FirstName='',

        /** @description Dependent's surname. */
        // @ApiMember(Description="Dependent's surname.", IsRequired=true)
        /** @var string */
        public string $Surname='',

        /** @description Dependent's mobile contact number. */
        // @ApiMember(Description="Dependent's mobile contact number.", IsRequired=true)
        /** @var string */
        public string $MobileNumber='',

        /** @description Dependent's email address. */
        // @ApiMember(Description="Dependent's email address.", IsRequired=true)
        /** @var string */
        public string $Email='',

        /** @description Depdendent's ID number. */
        // @ApiMember(Description="Depdendent's ID number.", IsRequired=true)
        /** @var string */
        public string $IdNumber=''
    ) {
    }

    /** @throws Exception */
    public function fromMap($o): void {
        if (isset($o['DependentId'])) $this->DependentId = $o['DependentId'];
        if (isset($o['FirstName'])) $this->FirstName = $o['FirstName'];
        if (isset($o['Surname'])) $this->Surname = $o['Surname'];
        if (isset($o['MobileNumber'])) $this->MobileNumber = $o['MobileNumber'];
        if (isset($o['Email'])) $this->Email = $o['Email'];
        if (isset($o['IdNumber'])) $this->IdNumber = $o['IdNumber'];
    }
    
    /** @throws Exception */
    public function jsonSerialize(): mixed
    {
        $o = [];
        if (isset($this->DependentId)) $o['DependentId'] = $this->DependentId;
        if (isset($this->FirstName)) $o['FirstName'] = $this->FirstName;
        if (isset($this->Surname)) $o['Surname'] = $this->Surname;
        if (isset($this->MobileNumber)) $o['MobileNumber'] = $this->MobileNumber;
        if (isset($this->Email)) $o['Email'] = $this->Email;
        if (isset($this->IdNumber)) $o['IdNumber'] = $this->IdNumber;
        return empty($o) ? new class(){} : $o;
    }
}

class UserLoginResponse extends ApiServiceResponse implements JsonSerializable
{
    /**
     * @param string|null $Description
     * @param string|null $Heading
     * @param bool|null $WasSuccessful
     * @param Object|null $ModelState
     */
    public function __construct(
        ?string $Description=null,
        ?string $Heading=null,
        ?bool $WasSuccessful=null,
        ?Object $ModelState=null,
        /** @description List of products the user has access to. */
        // @ApiMember(Description="List of products the user has access to.")
        /** @var array<UserProductData>|null */
        public ?array $UserProductInformation=null,

        /** @description List of all dependents linked to this user. */
        // @ApiMember(Description="List of all dependents linked to this user.")
        /** @var array<DependentData>|null */
        public ?array $Dependents=null
    ) {
        parent::__construct($Description,$Heading,$WasSuccessful,$ModelState);
    }

    /** @throws Exception */
    public function fromMap($o): void {
        parent::fromMap($o);
        if (isset($o['UserProductInformation'])) $this->UserProductInformation = JsonConverters::fromArray('UserProductData', $o['UserProductInformation']);
        if (isset($o['Dependents'])) $this->Dependents = JsonConverters::fromArray('DependentData', $o['Dependents']);
    }
    
    /** @throws Exception */
    public function jsonSerialize(): mixed
    {
        $o = parent::jsonSerialize();
        if (isset($this->UserProductInformation)) $o['UserProductInformation'] = JsonConverters::toArray('UserProductData', $this->UserProductInformation);
        if (isset($this->Dependents)) $o['Dependents'] = JsonConverters::toArray('DependentData', $this->Dependents);
        return empty($o) ? new class(){} : $o;
    }
}

class UserLoginRequest extends ApiServiceRequest implements JsonSerializable
{
    /**
     * @param string $ApiKey
     */
    public function __construct(
        string $ApiKey='',
        /** @description ID Number of the user to log in. */
        // @ApiMember(Description="ID Number of the user to log in.", IsRequired=true)
        /** @var string */
        public string $IdNumber=''
    ) {
        parent::__construct($ApiKey);
    }

    /** @throws Exception */
    public function fromMap($o): void {
        parent::fromMap($o);
        if (isset($o['IdNumber'])) $this->IdNumber = $o['IdNumber'];
    }
    
    /** @throws Exception */
    public function jsonSerialize(): mixed
    {
        $o = parent::jsonSerialize();
        if (isset($this->IdNumber)) $o['IdNumber'] = $this->IdNumber;
        return empty($o) ? new class(){} : $o;
    }
}

PHP UserLoginRequest DTOs

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

To embed the response in a jsonp callback, append ?callback=myCallback

HTTP + JSON

The following are sample HTTP requests and responses. The placeholders shown need to be replaced with actual values.

POST /user/login HTTP/1.1 
Host: galaxymobile.api.client.prod.86degrees.com 
Accept: application/json
Content-Type: application/json
Content-Length: length

{"IdNumber":"String","ApiKey":"String"}
HTTP/1.1 200 OK
Content-Type: application/json
Content-Length: length

{"UserProductInformation":[{"IntegrationType":0,"ProductId":0,"Name":"String","NameAfrikaans":"String","DashImageUrl":"String","ActionUrl":"String","Attachments":[{"FileName":"String","MainFileUrl":"String","ThumbnailUrl":"String","IsVideo":false,"IsImage":false,"IsPdf":false}],"DescriptionEng":"String","SummaryEng":"String","DescriptionAfr":"String","SummaryAfr":"String"}],"Dependents":[{"DependentId":0,"FirstName":"String","Surname":"String","MobileNumber":"String","Email":"String","IdNumber":"String"}],"Description":"String","Heading":"String","WasSuccessful":false,"ModelState":{}}