| POST | /user/login | Check that the user exists on Galaxy and set up their account and services. |
|---|
Imports System
Imports System.Collections
Imports System.Collections.Generic
Imports System.Runtime.Serialization
Imports ServiceStack
Imports ServiceStack.DataAnnotations
Imports WebService.ClientServiceModel.User
Imports WebService.ClientServiceModel.Base
Imports CommonService.Api.Models.Base
Imports BusinessLogic.Entities
Namespace Global
Namespace BusinessLogic.Entities
Public Enum IntegrationProviderType
None = 0
EA = 1
IlluminaHubProtectMe = 2
MyLegalHand = 3
AccidentAngels = 4
EmergencyServices = 5
MightyMobile = 6
Pulsit = 7
Bolt = 8
End Enum
End Namespace
Namespace CommonService.Api.Models.Base
Public Partial Class ApiServiceResponse
Implements IServiceResponse
Public Overridable Property Description As String
Public Overridable Property Heading As String
Public Overridable Property WasSuccessful As Boolean
Public Overridable Property ModelState As Object
End Class
End Namespace
Namespace WebService.ClientServiceModel.Base
Public Partial Class ApiServiceRequest
Implements IServiceRequest
Implements IHasApiKey
'''<Summary>
'''The API Key required for authentication
'''</Summary>
<ApiMember(DataType:="string", Description:="The API Key required for authentication", IsRequired:=true)>
Public Overridable Property ApiKey As String
End Class
End Namespace
Namespace WebService.ClientServiceModel.User
Public Partial Class DependentData
'''<Summary>
'''Dependent's Galaxy Id used for referring to or deleting.
'''</Summary>
<ApiMember(Description:="Dependent's Galaxy Id used for referring to or deleting.", IsRequired:=true)>
Public Overridable Property DependentId As Integer
'''<Summary>
'''Dependent's first name.
'''</Summary>
<ApiMember(Description:="Dependent's first name.", IsRequired:=true)>
Public Overridable Property FirstName As String
'''<Summary>
'''Dependent's surname.
'''</Summary>
<ApiMember(Description:="Dependent's surname.", IsRequired:=true)>
Public Overridable Property Surname As String
'''<Summary>
'''Dependent's mobile contact number.
'''</Summary>
<ApiMember(Description:="Dependent's mobile contact number.", IsRequired:=true)>
Public Overridable Property MobileNumber As String
'''<Summary>
'''Dependent's email address.
'''</Summary>
<ApiMember(Description:="Dependent's email address.", IsRequired:=true)>
Public Overridable Property Email As String
'''<Summary>
'''Depdendent's ID number.
'''</Summary>
<ApiMember(Description:="Depdendent's ID number.", IsRequired:=true)>
Public Overridable Property IdNumber As String
End Class
Public Partial Class UserLoginRequest
Inherits ApiServiceRequest
'''<Summary>
'''ID Number of the user to log in.
'''</Summary>
<ApiMember(Description:="ID Number of the user to log in.", IsRequired:=true)>
Public Overridable Property IdNumber As String
End Class
Public Partial Class UserLoginResponse
Inherits ApiServiceResponse
Public Sub New()
UserProductInformation = New List(Of UserProductData)
Dependents = New List(Of DependentData)
End Sub
'''<Summary>
'''List of products the user has access to.
'''</Summary>
<ApiMember(Description:="List of products the user has access to.")>
Public Overridable Property UserProductInformation As List(Of UserProductData)
'''<Summary>
'''List of all dependents linked to this user.
'''</Summary>
<ApiMember(Description:="List of all dependents linked to this user.")>
Public Overridable Property Dependents As List(Of DependentData)
End Class
Public Partial Class UserProductAttachmentData
Public Overridable Property FileName As String
Public Overridable Property MainFileUrl As String
Public Overridable Property ThumbnailUrl As String
Public Overridable Property IsVideo As Boolean
Public Overridable Property IsImage As Boolean
Public Overridable Property IsPdf As Boolean
End Class
Public Partial Class UserProductData
Public Sub New()
Attachments = New List(Of UserProductAttachmentData)
End Sub
Public Overridable Property IntegrationType As IntegrationProviderType
Public Overridable Property ProductId As Integer
Public Overridable Property Name As String
Public Overridable Property NameAfrikaans As String
Public Overridable Property DashImageUrl As String
Public Overridable Property ActionUrl As String
Public Overridable Property Attachments As List(Of UserProductAttachmentData)
Public Overridable Property DescriptionEng As String
Public Overridable Property SummaryEng As String
Public Overridable Property DescriptionAfr As String
Public Overridable Property SummaryAfr As String
End Class
End Namespace
End Namespace
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 /user/login HTTP/1.1
Host: galaxymobile.api.client.prod.86degrees.com
Accept: application/xml
Content-Type: application/xml
Content-Length: length
<UserLoginRequest xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.datacontract.org/2004/07/WebService.ClientServiceModel.User">
<ApiKey xmlns="http://schemas.datacontract.org/2004/07/WebService.ClientServiceModel.Base">String</ApiKey>
<IdNumber>String</IdNumber>
</UserLoginRequest>
HTTP/1.1 200 OK
Content-Type: application/xml
Content-Length: length
<UserLoginResponse xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.datacontract.org/2004/07/WebService.ClientServiceModel.User">
<Description xmlns="http://schemas.datacontract.org/2004/07/CommonService.Api.Models.Base">String</Description>
<Heading xmlns="http://schemas.datacontract.org/2004/07/CommonService.Api.Models.Base">String</Heading>
<ModelState xmlns="http://schemas.datacontract.org/2004/07/CommonService.Api.Models.Base" />
<WasSuccessful xmlns="http://schemas.datacontract.org/2004/07/CommonService.Api.Models.Base">false</WasSuccessful>
<Dependents>
<DependentData>
<DependentId>0</DependentId>
<Email>String</Email>
<FirstName>String</FirstName>
<IdNumber>String</IdNumber>
<MobileNumber>String</MobileNumber>
<Surname>String</Surname>
</DependentData>
</Dependents>
<UserProductInformation>
<UserProductData>
<ActionUrl>String</ActionUrl>
<Attachments>
<UserProductAttachmentData>
<FileName>String</FileName>
<IsImage>false</IsImage>
<IsPdf>false</IsPdf>
<IsVideo>false</IsVideo>
<MainFileUrl>String</MainFileUrl>
<ThumbnailUrl>String</ThumbnailUrl>
</UserProductAttachmentData>
</Attachments>
<DashImageUrl>String</DashImageUrl>
<DescriptionAfr>String</DescriptionAfr>
<DescriptionEng>String</DescriptionEng>
<IntegrationType>None</IntegrationType>
<Name>String</Name>
<NameAfrikaans>String</NameAfrikaans>
<ProductId>0</ProductId>
<SummaryAfr>String</SummaryAfr>
<SummaryEng>String</SummaryEng>
</UserProductData>
</UserProductInformation>
</UserLoginResponse>