Field Squared API Services

<back to all web services

ApiTrafficLogs

Returns recent log entries
Pagination - /?recstart=0&reccount=1

The following routes are available for this service:
GET/{Workspace}/ApiTrafficLog
import 'package:servicestack/servicestack.dart';

class ApiLogEntry implements IConvertible
{
    String? Id;
    String? RuleName;
    String? Date;
    String? Workspace;
    String? Url;
    String? Method;
    String? Payload;
    String? Direction;

    ApiLogEntry({this.Id,this.RuleName,this.Date,this.Workspace,this.Url,this.Method,this.Payload,this.Direction});
    ApiLogEntry.fromJson(Map<String, dynamic> json) { fromMap(json); }

    fromMap(Map<String, dynamic> json) {
        Id = json['Id'];
        RuleName = json['RuleName'];
        Date = json['Date'];
        Workspace = json['Workspace'];
        Url = json['Url'];
        Method = json['Method'];
        Payload = json['Payload'];
        Direction = json['Direction'];
        return this;
    }

    Map<String, dynamic> toJson() => {
        'Id': Id,
        'RuleName': RuleName,
        'Date': Date,
        'Workspace': Workspace,
        'Url': Url,
        'Method': Method,
        'Payload': Payload,
        'Direction': Direction
    };

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

/**
* Returns recent log entriesPagination - /?recstart=0&reccount=1
*/
class ApiTrafficLogs implements IConvertible
{
    String? Workspace;
    List<ApiLogEntry>? Entries;
    int? RecordsAvailable;

    ApiTrafficLogs({this.Workspace,this.Entries,this.RecordsAvailable});
    ApiTrafficLogs.fromJson(Map<String, dynamic> json) { fromMap(json); }

    fromMap(Map<String, dynamic> json) {
        Workspace = json['Workspace'];
        Entries = JsonConverters.fromJson(json['Entries'],'List<ApiLogEntry>',context!);
        RecordsAvailable = json['RecordsAvailable'];
        return this;
    }

    Map<String, dynamic> toJson() => {
        'Workspace': Workspace,
        'Entries': JsonConverters.toJson(Entries,'List<ApiLogEntry>',context!),
        'RecordsAvailable': RecordsAvailable
    };

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

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

Dart ApiTrafficLogs 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}/ApiTrafficLog HTTP/1.1 
Host: dev.fieldsquared.com 
Accept: text/jsv