Field Squared API Services

<back to all web services

WorkspaceLogs

Returns recent log entries, optionally filtered by log level1
Pagination - /?recstart=0&reccount=1Log Levels - /?levels=WARN,ERROR

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

class LogEntry implements IConvertible
{
    String? Id;
    String? WorkspaceId;
    String? RuleId;
    String? Date;
    String? Thread;
    String? Level;
    String? Name;
    String? Message;
    String? Context;

    LogEntry({this.Id,this.WorkspaceId,this.RuleId,this.Date,this.Thread,this.Level,this.Name,this.Message,this.Context});
    LogEntry.fromJson(Map<String, dynamic> json) { fromMap(json); }

    fromMap(Map<String, dynamic> json) {
        Id = json['Id'];
        WorkspaceId = json['WorkspaceId'];
        RuleId = json['RuleId'];
        Date = json['Date'];
        Thread = json['Thread'];
        Level = json['Level'];
        Name = json['Name'];
        Message = json['Message'];
        Context = json['Context'];
        return this;
    }

    Map<String, dynamic> toJson() => {
        'Id': Id,
        'WorkspaceId': WorkspaceId,
        'RuleId': RuleId,
        'Date': Date,
        'Thread': Thread,
        'Level': Level,
        'Name': Name,
        'Message': Message,
        'Context': Context
    };

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

/**
* Returns recent log entries, optionally filtered by log level1Pagination - /?recstart=0&reccount=1Log Levels - /?levels=WARN,ERROR
*/
class WorkspaceLogs implements IConvertible
{
    String? Workspace;
    List<LogEntry>? Entries;
    int? RecordsAvailable;

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

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

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

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

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

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

GET /{Workspace}/IntegrationLog HTTP/1.1 
Host: dev.fieldsquared.com 
Accept: text/csv