Trendsic Platform Service

<back to all web services

FormReportRequest

Requires Authentication
The following routes are available for this service:
GET/v1/forms/{FormUID}/reports
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 FormReportBar:
    id: Optional[str] = None
    label: Optional[str] = None
    n: int = 0
    value: float = 0.0
    text: Optional[str] = None
    tone: Optional[str] = None


@dataclass_json(letter_case=LetterCase.CAMEL, undefined=Undefined.EXCLUDE)
@dataclass
class FormReportResponse:
    submissions: int = 0
    decided: int = 0
    approved: int = 0
    rate_text: Optional[str] = None
    decision_text: Optional[str] = None
    drafts: int = 0
    sla: int = 0
    draft_days: int = 0
    is_record: bool = False
    weeks: List[FormReportBar] = field(default_factory=list)
    stages: List[FormReportBar] = field(default_factory=list)
    pages: List[FormReportBar] = field(default_factory=list)
    started: int = 0
    submitted_pct: int = 0
    drop_from: Optional[str] = None
    drop_n: int = 0
    durations: List[FormReportBar] = field(default_factory=list)
    fields: List[FormReportBar] = field(default_factory=list)
    field: Optional[str] = None
    field_label: Optional[str] = None
    options: List[FormReportBar] = field(default_factory=list)
    reasons: List[FormReportBar] = field(default_factory=list)
    response_status: Optional[ResponseStatus] = None


@dataclass_json(letter_case=LetterCase.CAMEL, undefined=Undefined.EXCLUDE)
@dataclass
class FormReportRequest:
    form_u_i_d: Optional[str] = None
    field: Optional[str] = None

Python FormReportRequest 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 /v1/forms/{FormUID}/reports HTTP/1.1 
Host: api.dev.dynamics.trendsic.com 
Accept: text/jsv
HTTP/1.1 200 OK
Content-Type: text/jsv
Content-Length: length

{
	Submissions: 0,
	Decided: 0,
	Approved: 0,
	RateText: String,
	DecisionText: String,
	Drafts: 0,
	Sla: 0,
	DraftDays: 0,
	IsRecord: False,
	Weeks: 
	[
		{
			Id: String,
			Label: String,
			N: 0,
			Value: 0,
			Text: String,
			Tone: String
		}
	],
	Stages: 
	[
		{
			Id: String,
			Label: String,
			N: 0,
			Value: 0,
			Text: String,
			Tone: String
		}
	],
	Pages: 
	[
		{
			Id: String,
			Label: String,
			N: 0,
			Value: 0,
			Text: String,
			Tone: String
		}
	],
	Started: 0,
	SubmittedPct: 0,
	DropFrom: String,
	DropN: 0,
	Durations: 
	[
		{
			Id: String,
			Label: String,
			N: 0,
			Value: 0,
			Text: String,
			Tone: String
		}
	],
	Fields: 
	[
		{
			Id: String,
			Label: String,
			N: 0,
			Value: 0,
			Text: String,
			Tone: String
		}
	],
	Field: String,
	FieldLabel: String,
	Options: 
	[
		{
			Id: String,
			Label: String,
			N: 0,
			Value: 0,
			Text: String,
			Tone: String
		}
	],
	Reasons: 
	[
		{
			Id: String,
			Label: String,
			N: 0,
			Value: 0,
			Text: String,
			Tone: String
		}
	],
	ResponseStatus: 
	{
		ErrorCode: String,
		Message: String,
		StackTrace: String,
		Errors: 
		[
			{
				ErrorCode: String,
				FieldName: String,
				Message: String,
				Meta: 
				{
					String: String
				}
			}
		],
		Meta: 
		{
			String: String
		}
	}
}