Trendsic Platform Service

<back to all web services

SafetyComplianceRequest

Requires Authentication
The following routes are available for this service:
GET,OPTIONS/v1/safety/compliance
import Foundation
import ServiceStack

public class SafetyComplianceRequest : Codable
{
    public var days:Int

    required public init(){}
}

public class SafetyComplianceResponse : Codable
{
    public var responseStatus:ResponseStatus
    public var kpis:SafetyComplianceKpis
    public var projects:[SafetyComplianceProject] = []
    public var trend:[SafetyTrendWeek] = []
    public var incidentMix:[SafetyIncidentMixRow] = []
    public var missingTalks:[SafetyMissingTalk] = []

    required public init(){}
}

public class SafetyComplianceKpis : Codable
{
    public var participationPct:Int
    public var openIncidents:Int
    public var overdueCAs:Int
    public var recordables12mo:Int
    public var daysWithoutRecordable:Int
    public var projectsWithTalkToday:Int
    public var projectsWithCrewToday:Int

    required public init(){}
}

public class SafetyComplianceProject : Codable
{
    public var projectID:Int
    public var projectUID:String
    public var projectName:String
    public var branch:String
    public var crewCount:Int
    public var hasTalkToday:Bool
    public var talkAckPct:Int
    public var openIncidents:Int
    public var overdueCAs:Int
    public var recordables12mo:Int

    required public init(){}
}

public class SafetyTrendWeek : Codable
{
    public var weekStart:String
    public var acks:Int
    public var roster:Int

    required public init(){}
}

public class SafetyIncidentMixRow : Codable
{
    public var severity:String
    public var cnt:Int

    required public init(){}
}

public class SafetyMissingTalk : Codable
{
    public var projectID:Int
    public var projectUID:String
    public var projectName:String
    public var crewCount:Int

    required public init(){}
}


Swift SafetyComplianceRequest DTOs

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

HTTP + XML

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

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

<SafetyComplianceResponse xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.datacontract.org/2004/07/CRM.AgencyPlatform.API.Internal">
  <IncidentMix>
    <SafetyIncidentMixRow>
      <Cnt>0</Cnt>
      <Severity>String</Severity>
    </SafetyIncidentMixRow>
  </IncidentMix>
  <Kpis>
    <DaysWithoutRecordable>0</DaysWithoutRecordable>
    <OpenIncidents>0</OpenIncidents>
    <OverdueCAs>0</OverdueCAs>
    <ParticipationPct>0</ParticipationPct>
    <ProjectsWithCrewToday>0</ProjectsWithCrewToday>
    <ProjectsWithTalkToday>0</ProjectsWithTalkToday>
    <Recordables12mo>0</Recordables12mo>
  </Kpis>
  <MissingTalks>
    <SafetyMissingTalk>
      <CrewCount>0</CrewCount>
      <ProjectID>0</ProjectID>
      <ProjectName>String</ProjectName>
      <ProjectUID>String</ProjectUID>
    </SafetyMissingTalk>
  </MissingTalks>
  <Projects>
    <SafetyComplianceProject>
      <Branch>String</Branch>
      <CrewCount>0</CrewCount>
      <HasTalkToday>false</HasTalkToday>
      <OpenIncidents>0</OpenIncidents>
      <OverdueCAs>0</OverdueCAs>
      <ProjectID>0</ProjectID>
      <ProjectName>String</ProjectName>
      <ProjectUID>String</ProjectUID>
      <Recordables12mo>0</Recordables12mo>
      <TalkAckPct>0</TalkAckPct>
    </SafetyComplianceProject>
  </Projects>
  <ResponseStatus xmlns:d2p1="http://schemas.servicestack.net/types">
    <d2p1:ErrorCode>String</d2p1:ErrorCode>
    <d2p1:Message>String</d2p1:Message>
    <d2p1:StackTrace>String</d2p1:StackTrace>
    <d2p1:Errors>
      <d2p1:ResponseError>
        <d2p1:ErrorCode>String</d2p1:ErrorCode>
        <d2p1:FieldName>String</d2p1:FieldName>
        <d2p1:Message>String</d2p1:Message>
        <d2p1:Meta xmlns:d5p1="http://schemas.microsoft.com/2003/10/Serialization/Arrays">
          <d5p1:KeyValueOfstringstring>
            <d5p1:Key>String</d5p1:Key>
            <d5p1:Value>String</d5p1:Value>
          </d5p1:KeyValueOfstringstring>
        </d2p1:Meta>
      </d2p1:ResponseError>
    </d2p1:Errors>
    <d2p1:Meta xmlns:d3p1="http://schemas.microsoft.com/2003/10/Serialization/Arrays">
      <d3p1:KeyValueOfstringstring>
        <d3p1:Key>String</d3p1:Key>
        <d3p1:Value>String</d3p1:Value>
      </d3p1:KeyValueOfstringstring>
    </d2p1:Meta>
  </ResponseStatus>
  <Trend>
    <SafetyTrendWeek>
      <Acks>0</Acks>
      <Roster>0</Roster>
      <WeekStart>String</WeekStart>
    </SafetyTrendWeek>
  </Trend>
</SafetyComplianceResponse>