Field Squared API Services

<back to all web services

Authentication

The following routes are available for this service:
POST/Authentication
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 Authentication:
    email: Optional[str] = None
    password: Optional[str] = None
    code: Optional[str] = None
    subscription_object: Optional[Object] = None
    device_id: Optional[str] = None


@dataclass_json(letter_case=LetterCase.CAMEL, undefined=Undefined.EXCLUDE)
@dataclass
class AuthenticationResponse:
    auth_token: Optional[str] = None
    workspace: Optional[str] = None
    user_id: Optional[str] = None
    teams: Optional[List[str]] = None
    mobile_task_range_past: int = 0
    mobile_task_range_future: int = 0
    retain_customer_database: Optional[str] = None
    retain_asset_database: Optional[str] = None
    user_type: Optional[str] = None

Python Authentication DTOs

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

HTTP + CSV

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

POST /Authentication HTTP/1.1 
Host: dev.fieldsquared.com 
Accept: text/csv
Content-Type: text/csv
Content-Length: length

{"Email":"String","Password":"String","Code":"String","SubscriptionObject":{},"DeviceId":"String"}
HTTP/1.1 200 OK
Content-Type: text/csv
Content-Length: length

{"AuthToken":"String","Workspace":"String","UserId":"String","Teams":["String"],"MobileTaskRangePast":0,"MobileTaskRangeFuture":0,"RetainCustomerDatabase":"String","RetainAssetDatabase":"String","UserType":"String"}