DigiOffice API Services Services

<back to all web services

GetAnalyticsInfo

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 AnalyticsLogInfo:
    id: int = 0
    date_time: datetime.datetime = datetime.datetime(1, 1, 1)
    browser: Optional[str] = None
    device: Optional[str] = None
    bot: Optional[str] = None
    op: Optional[str] = None
    user_id: Optional[str] = None
    user_name: Optional[str] = None
    api_key: Optional[str] = None
    ip: Optional[str] = None


@dataclass_json(letter_case=LetterCase.CAMEL, undefined=Undefined.EXCLUDE)
@dataclass
class GetAnalyticsInfoResponse:
    months: Optional[List[str]] = None
    result: Optional[AnalyticsLogInfo] = None
    response_status: Optional[ResponseStatus] = None


@dataclass_json(letter_case=LetterCase.CAMEL, undefined=Undefined.EXCLUDE)
@dataclass
class GetAnalyticsInfo(IGet):
    month: Optional[datetime.datetime] = None
    type: Optional[str] = None
    op: Optional[str] = None
    api_key: Optional[str] = None
    user_id: Optional[str] = None
    ip: Optional[str] = None

Python GetAnalyticsInfo 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 /jsv/reply/GetAnalyticsInfo HTTP/1.1 
Host: test-do-services.klokgroep.nl 
Accept: text/jsv
Content-Type: text/jsv
Content-Length: length

{
	Month: 0001-01-01,
	Type: String,
	Op: String,
	ApiKey: String,
	UserId: String,
	Ip: String
}
HTTP/1.1 200 OK
Content-Type: text/jsv
Content-Length: length

{
	Months: 
	[
		String
	],
	Result: 
	{
		Id: 0,
		DateTime: 0001-01-01,
		Browser: String,
		Device: String,
		Bot: String,
		Op: String,
		UserId: String,
		UserName: String,
		ApiKey: String,
		Ip: String
	},
	ResponseStatus: 
	{
		ErrorCode: String,
		Message: String,
		StackTrace: String,
		Errors: 
		[
			{
				ErrorCode: String,
				FieldName: String,
				Message: String,
				Meta: 
				{
					String: String
				}
			}
		],
		Meta: 
		{
			String: String
		}
	}
}