Trendsic Platform Service

<back to all web services

SafetyIncidentListRequest

Requires Authentication
The following routes are available for this service:
GET,OPTIONS/v1/safety/incidents
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 SafetyIncident:
    safety_incident_i_d: int = 0
    safety_incident_u_i_d: Optional[str] = None
    branch_id: Optional[str] = None
    project_i_d: Optional[int] = None
    incident_no: Optional[str] = None
    incident_type: Optional[str] = None
    severity: Optional[str] = None
    status: Optional[str] = None
    title: Optional[str] = None
    location: Optional[str] = None
    crew_label: Optional[str] = None
    description: Optional[str] = None
    reported_by: Optional[str] = None
    is_recordable: bool = False
    occurred_at: Optional[datetime.datetime] = None
    closed_at: Optional[datetime.datetime] = None
    source_ref: Optional[str] = None
    created_by: Optional[str] = None
    created_at: Optional[datetime.datetime] = None
    updated_at: Optional[datetime.datetime] = None
    days_ago: int = 0


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


@dataclass_json(letter_case=LetterCase.CAMEL, undefined=Undefined.EXCLUDE)
@dataclass
class SafetyIncidentListRequest:
    from_date: Optional[datetime.datetime] = None
    to_date: Optional[datetime.datetime] = None
    project_i_d: Optional[int] = None

Python SafetyIncidentListRequest DTOs

To override the Content-type in your clients, use the HTTP Accept Header, append the .json suffix or ?format=json

To embed the response in a jsonp callback, append ?callback=myCallback

HTTP + JSON

The following are sample HTTP requests and responses. The placeholders shown need to be replaced with actual values.

GET /v1/safety/incidents HTTP/1.1 
Host: api.dev.dynamics.trendsic.com 
Accept: application/json
HTTP/1.1 200 OK
Content-Type: application/json
Content-Length: length

{"ResponseStatus":{"ErrorCode":"String","Message":"String","StackTrace":"String","Errors":[{"ErrorCode":"String","FieldName":"String","Message":"String","Meta":{"String":"String"}}],"Meta":{"String":"String"}},"Incidents":[{"SafetyIncidentID":0,"SafetyIncidentUID":"00000000000000000000000000000000","BranchId":"00000000000000000000000000000000","ProjectID":0,"IncidentNo":"String","IncidentType":"String","Severity":"String","Status":"String","Title":"String","Location":"String","CrewLabel":"String","Description":"String","ReportedBy":"String","IsRecordable":false,"OccurredAt":"0001-01-01T00:00:00.0000000","ClosedAt":"0001-01-01T00:00:00.0000000","SourceRef":"String","CreatedBy":"String","CreatedAt":"0001-01-01T00:00:00.0000000","UpdatedAt":"0001-01-01T00:00:00.0000000","DaysAgo":0}]}