Trendsic Platform Service

<back to all web services

AccessLogRequest

Requires Authentication
Requires any of the roles:Worker, Agent, Administrator
The following routes are available for this service:
GET,POST,OPTIONS/v1/AccessLog
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 ErrorLog:
    error_log_id: int = 0
    message: Optional[str] = None
    page: Optional[str] = None
    line_number: int = 0
    col_number: int = 0
    user_agent: Optional[str] = None
    log_date: datetime.datetime = datetime.datetime(1, 1, 1)


@dataclass_json(letter_case=LetterCase.CAMEL, undefined=Undefined.EXCLUDE)
@dataclass
class ErrorLogResponse:
    response_status: Optional[ResponseStatus] = None
    error_log: List[ErrorLog] = field(default_factory=list)


@dataclass_json(letter_case=LetterCase.CAMEL, undefined=Undefined.EXCLUDE)
@dataclass
class AccessLog:
    id: int = 0
    logged_in_user: Optional[str] = None
    selected_agent: Optional[str] = None
    ip: Optional[str] = None
    description: Optional[str] = None
    log_date: datetime.datetime = datetime.datetime(1, 1, 1)


@dataclass_json(letter_case=LetterCase.CAMEL, undefined=Undefined.EXCLUDE)
@dataclass
class AccessLogRequest:
    access_log: List[AccessLog] = field(default_factory=list)

Python AccessLogRequest 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.

POST /v1/AccessLog HTTP/1.1 
Host: api.dev.dynamics.trendsic.com 
Accept: text/jsv
Content-Type: text/jsv
Content-Length: length

{
	AccessLog: 
	[
		{
			Id: 0,
			LoggedInUser: String,
			SelectedAgent: String,
			IP: String,
			Description: String,
			LogDate: 0001-01-01
		}
	]
}
HTTP/1.1 200 OK
Content-Type: text/jsv
Content-Length: length

{
	ResponseStatus: 
	{
		ErrorCode: String,
		Message: String,
		StackTrace: String,
		Errors: 
		[
			{
				ErrorCode: String,
				FieldName: String,
				Message: String,
				Meta: 
				{
					String: String
				}
			}
		],
		Meta: 
		{
			String: String
		}
	},
	ErrorLog: 
	[
		{
			ErrorLogId: 0,
			Message: String,
			Page: String,
			LineNumber: 0,
			ColNumber: 0,
			UserAgent: String,
			LogDate: 0001-01-01
		}
	]
}