| POST | /user/login |
|---|
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):
# @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):
# @ApiMember(Description="Information about the response.", IsRequired=true)
description: Optional[str] = None
"""
Information about the response.
"""
# @ApiMember(Description="Heading or summary of the response.", IsRequired=true)
heading: Optional[str] = None
"""
Heading or summary of the response.
"""
# @ApiMember(DataType="boolean", Description="Did the intended operation for this response complete successfully?", IsRequired=true)
was_successful: bool = False
"""
Did the intended operation for this response complete successfully?
"""
response_status: Optional[ResponseStatus] = None
@dataclass_json(letter_case=LetterCase.CAMEL, undefined=Undefined.EXCLUDE)
@dataclass
class StockOperatorData:
id: int = 0
name: Optional[str] = None
@dataclass_json(letter_case=LetterCase.CAMEL, undefined=Undefined.EXCLUDE)
@dataclass
class ClaimNumberRule:
principal_id: int = 0
channel_name: Optional[str] = None
rule_pattern: 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
friendly_name: Optional[str] = None
vat_value: Decimal = decimal.Decimal(0)
can_uplift: bool = False
stock_can_drop_off: bool = False
stock_can_close_arrival: bool = False
block_uplift_if_line_count_does_not_match: bool = False
block_uplift_if_quantity_does_not_match: bool = False
can_rip_tip: bool = False
can_delete_uplifts: bool = False
stock_operators: Optional[List[StockOperatorData]] = None
claim_number_rules: Optional[List[ClaimNumberRule]] = None
uplift_sync_interval: int = 0
late_uplift_threshold: int = 0
pause_uplift_reasons: Optional[List[str]] = None
no_goods_to_uplift_reasons: Optional[List[str]] = None
blurry_image_error_score: Decimal = decimal.Decimal(0)
blurry_image_warning_score: Decimal = decimal.Decimal(0)
blurry_image_detection_enabled: bool = False
profile_image_url: Optional[str] = None
claim_value_warning_variance: float = 0.0
stock_can_vehicle_assignment: bool = False
stock_can_operator_assignment: bool = False
stock_can_stock_end: bool = False
stock_can_check_seal_details: bool = False
stock_manual_enabled: bool = False
@dataclass_json(letter_case=LetterCase.CAMEL, undefined=Undefined.EXCLUDE)
@dataclass
class UserLoginResponse(ApiServiceResponse):
data: Optional[LoginData] = None
@dataclass_json(letter_case=LetterCase.CAMEL, undefined=Undefined.EXCLUDE)
@dataclass
class UserLogin(ApiServiceRequest):
email_address: Optional[str] = None
password: Optional[str] = None
utc_offset: int = 0
# @ApiMember(Description="The user's push token - used for push messages.")
push_player_id: Optional[str] = None
"""
The user's push token - used for push messages.
"""
# @ApiMember(Description="Refresh token used to auto login the user.")
refresh_token: Optional[str] = None
"""
Refresh token used to auto login the user.
"""
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
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: antel.api.dev.86degrees.com
Accept: application/json
Content-Type: application/json
Content-Length: length
{"emailAddress":"String","password":"String","utcOffset":0,"pushPlayerId":"String","refreshToken":"String","apiKey":"String","latitude":0,"longitude":0}
HTTP/1.1 200 OK
Content-Type: application/json
Content-Length: length
{"data":{"systemUserId":0,"refreshToken":"String","friendlyName":"String","vatValue":0,"canUplift":false,"stockCanDropOff":false,"stockCanCloseArrival":false,"blockUpliftIfLineCountDoesNotMatch":false,"blockUpliftIfQuantityDoesNotMatch":false,"canRipTip":false,"canDeleteUplifts":false,"stockOperators":[{}],"claimNumberRules":[{}],"upliftSyncInterval":0,"lateUpliftThreshold":0,"pauseUpliftReasons":["String"],"noGoodsToUpliftReasons":["String"],"blurryImageErrorScore":0,"blurryImageWarningScore":0,"blurryImageDetectionEnabled":false,"profileImageUrl":"String","claimValueWarningVariance":0,"stockCanVehicleAssignment":false,"stockCanOperatorAssignment":false,"stockCanStockEnd":false,"stockCanCheckSealDetails":false,"stockManualEnabled":false},"description":"String","heading":"String","wasSuccessful":false,"responseStatus":{"errorCode":"String","message":"String","stackTrace":"String","errors":[{"errorCode":"String","fieldName":"String","message":"String","meta":{"String":"String"}}],"meta":{"String":"String"}}}