Field Squared API Services

<back to all web services

ArrivalDepartureList

Returns a list of ArrivalDeparture objects, based on the criteria within the end point.
/{Workspace}/ArrivalDeparture/User/{ObjectId}/History/{Days}/ - GET - Return the history of a
specific user for X days, sorted by arrival date descending.
/{Workspace}/ArrivalDeparture/History/{Days} - GET - Return the history of all users for X days,
sorted by user descending then arrival date descending.
/{Workspace}/ArrivalDeparture/Current - GET - Return the latest arrival departure object for each
user, sorted by arrivaldate descending.
/{Workspace}/ArrivalDepartureList/Task/{ObjectId}/History/ - GET - Return the history of all arrival
departure objects related to a specific task.
/{Workspace}/ArrivalDepartureList/Contact/{ObjectId}/History/ - GET - Return the history of all arrival
departure objects related to a specific contact.

The following routes are available for this service:
GET/{Workspace}/ArrivalDepartureList/Current
GET/{Workspace}/ArrivalDepartureList/History/{Days}
GET/{Workspace}/ArrivalDepartureList/User/{ObjectId}/History/{Days}/
GET/{Workspace}/ArrivalDepartureList/Task/{ObjectId}/History/
GET/{Workspace}/ArrivalDepartureList/Contact/{ObjectId}/History/
import 'package:servicestack/servicestack.dart';

class Location implements IConvertible
{
    double? y;
    double? x;

    Location({this.y,this.x});
    Location.fromJson(Map<String, dynamic> json) { fromMap(json); }

    fromMap(Map<String, dynamic> json) {
        y = JsonConverters.toDouble(json['y']);
        x = JsonConverters.toDouble(json['x']);
        return this;
    }

    Map<String, dynamic> toJson() => {
        'y': y,
        'x': x
    };

    getTypeName() => "Location";
    TypeContext? context = _ctx;
}

/**
* Service representing an ArrivalDeparture object in a workspace.
*/
class ArrivalDeparture implements IConvertible
{
    String? Workspace;
    String? ObjectId;
    String? ArrivalTime;
    String? DepartureTime;
    Location? GeofenceLocation;
    String? GeofenceId;
    double? GeofenceRadius;
    String? User;
    String? Task;

    ArrivalDeparture({this.Workspace,this.ObjectId,this.ArrivalTime,this.DepartureTime,this.GeofenceLocation,this.GeofenceId,this.GeofenceRadius,this.User,this.Task});
    ArrivalDeparture.fromJson(Map<String, dynamic> json) { fromMap(json); }

    fromMap(Map<String, dynamic> json) {
        Workspace = json['Workspace'];
        ObjectId = json['ObjectId'];
        ArrivalTime = json['ArrivalTime'];
        DepartureTime = json['DepartureTime'];
        GeofenceLocation = JsonConverters.fromJson(json['GeofenceLocation'],'Location',context!);
        GeofenceId = json['GeofenceId'];
        GeofenceRadius = JsonConverters.toDouble(json['GeofenceRadius']);
        User = json['User'];
        Task = json['Task'];
        return this;
    }

    Map<String, dynamic> toJson() => {
        'Workspace': Workspace,
        'ObjectId': ObjectId,
        'ArrivalTime': ArrivalTime,
        'DepartureTime': DepartureTime,
        'GeofenceLocation': JsonConverters.toJson(GeofenceLocation,'Location',context!),
        'GeofenceId': GeofenceId,
        'GeofenceRadius': GeofenceRadius,
        'User': User,
        'Task': Task
    };

    getTypeName() => "ArrivalDeparture";
    TypeContext? context = _ctx;
}

/**
* Returns a list of ArrivalDeparture objects, based on the criteria within the end point. /{Workspace}/ArrivalDeparture/User/{ObjectId}/History/{Days}/ - GET - Return the history of a specific user for X days, sorted by arrival date descending. /{Workspace}/ArrivalDeparture/History/{Days} - GET - Return the history of all users for X days, sorted by user descending then arrival date descending. /{Workspace}/ArrivalDeparture/Current - GET - Return the latest arrival departure object for each user, sorted by arrivaldate descending./{Workspace}/ArrivalDepartureList/Task/{ObjectId}/History/ - GET - Return the history of all arrival departure objects related to a specific task./{Workspace}/ArrivalDepartureList/Contact/{ObjectId}/History/ - GET - Return the history of all arrival departure objects related to a specific contact.
*/
class ArrivalDepartureList implements IConvertible
{
    String? Workspace;
    String? ObjectId;
    String? Days;
    String? DateGenerated;
    List<ArrivalDeparture>? ArrivalDepartures;

    ArrivalDepartureList({this.Workspace,this.ObjectId,this.Days,this.DateGenerated,this.ArrivalDepartures});
    ArrivalDepartureList.fromJson(Map<String, dynamic> json) { fromMap(json); }

    fromMap(Map<String, dynamic> json) {
        Workspace = json['Workspace'];
        ObjectId = json['ObjectId'];
        Days = json['Days'];
        DateGenerated = json['DateGenerated'];
        ArrivalDepartures = JsonConverters.fromJson(json['ArrivalDepartures'],'List<ArrivalDeparture>',context!);
        return this;
    }

    Map<String, dynamic> toJson() => {
        'Workspace': Workspace,
        'ObjectId': ObjectId,
        'Days': Days,
        'DateGenerated': DateGenerated,
        'ArrivalDepartures': JsonConverters.toJson(ArrivalDepartures,'List<ArrivalDeparture>',context!)
    };

    getTypeName() => "ArrivalDepartureList";
    TypeContext? context = _ctx;
}

TypeContext _ctx = TypeContext(library: 'dev.fieldsquared.com', types: <String, TypeInfo> {
    'Location': TypeInfo(TypeOf.Class, create:() => Location()),
    'ArrivalDeparture': TypeInfo(TypeOf.Class, create:() => ArrivalDeparture()),
    'ArrivalDepartureList': TypeInfo(TypeOf.Class, create:() => ArrivalDepartureList()),
    'List<ArrivalDeparture>': TypeInfo(TypeOf.Class, create:() => <ArrivalDeparture>[]),
});

Dart ArrivalDepartureList 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.

GET /{Workspace}/ArrivalDepartureList/Current HTTP/1.1 
Host: dev.fieldsquared.com 
Accept: text/jsv