Cochrane+ App API

<back to all web services

AttendanceSessionStatusChangeRequest

Requires Authentication
The following routes are available for this service:
POST/attendance/sessionstatus
"use strict";
export class ApiServiceRequest {
    /** @param {{apiKey?:string,latitude?:number,longitude?:number}} [init] */
    constructor(init) { Object.assign(this, init) }
    /**
     * @type {string}
     * @description The API Key required for authentication */
    apiKey;
    /**
     * @type {number}
     * @description Latitude of the user making this request */
    latitude;
    /**
     * @type {number}
     * @description Longitude of the user making this request */
    longitude;
}
export class ApiServiceResponse {
    /** @param {{description?:string,heading?:string,wasSuccessful?:boolean,modelState?:Object}} [init] */
    constructor(init) { Object.assign(this, init) }
    /** @type {string} */
    description;
    /** @type {string} */
    heading;
    /** @type {boolean} */
    wasSuccessful;
    /** @type {Object} */
    modelState;
}
/** @typedef {number} */
export var AttendanceEventType;
(function (AttendanceEventType) {
    AttendanceEventType[AttendanceEventType["ClockOut"] = 0] = "ClockOut"
    AttendanceEventType[AttendanceEventType["ClockIn"] = 1] = "ClockIn"
    AttendanceEventType[AttendanceEventType["StartLunch"] = 2] = "StartLunch"
    AttendanceEventType[AttendanceEventType["EndLunch"] = 3] = "EndLunch"
    AttendanceEventType[AttendanceEventType["StartBreak"] = 4] = "StartBreak"
    AttendanceEventType[AttendanceEventType["EndBreak"] = 5] = "EndBreak"
})(AttendanceEventType || (AttendanceEventType = {}));
export class AttendanceEventData {
    /** @param {{type?:AttendanceEventType,time?:string,location?:string}} [init] */
    constructor(init) { Object.assign(this, init) }
    /** @type {AttendanceEventType} */
    type;
    /** @type {string} */
    time;
    /** @type {string} */
    location;
}
export class AttendanceSessionInfo {
    /** @param {{attendanceSessionId?:number,attendanceGoalTime?:number,attendanceGoalTimeValue?:string,attendanceEvents?:AttendanceEventData[],startDate?:string,endDate?:string,isClockedIn?:boolean,timeElapsed?:number,latestEventType?:AttendanceEventType,totalBreakTime?:number,totalLunchTime?:number,isNew?:boolean}} [init] */
    constructor(init) { Object.assign(this, init) }
    /** @type {number} */
    attendanceSessionId;
    /** @type {number} */
    attendanceGoalTime;
    /** @type {string} */
    attendanceGoalTimeValue;
    /** @type {AttendanceEventData[]} */
    attendanceEvents;
    /** @type {string} */
    startDate;
    /** @type {string} */
    endDate;
    /** @type {boolean} */
    isClockedIn;
    /** @type {number} */
    timeElapsed;
    /** @type {AttendanceEventType} */
    latestEventType;
    /** @type {number} */
    totalBreakTime;
    /** @type {number} */
    totalLunchTime;
    /** @type {boolean} */
    isNew;
}
export class GetAttendanceSessionInfoResponse extends ApiServiceResponse {
    /** @param {{sessionInfo?:AttendanceSessionInfo,description?:string,heading?:string,wasSuccessful?:boolean,modelState?:Object}} [init] */
    constructor(init) { super(init); Object.assign(this, init) }
    /** @type {AttendanceSessionInfo} */
    sessionInfo;
}
export class AttendanceSessionStatusChangeRequest extends ApiServiceRequest {
    /** @param {{attendanceSessionId?:number,eventType?:AttendanceEventType,timeZoneName?:string,apiKey?:string,latitude?:number,longitude?:number}} [init] */
    constructor(init) { super(init); Object.assign(this, init) }
    /** @type {number} */
    attendanceSessionId;
    /** @type {AttendanceEventType} */
    eventType;
    /** @type {string} */
    timeZoneName;
}

JavaScript AttendanceSessionStatusChangeRequest DTOs

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

HTTP + OTHER

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

POST /attendance/sessionstatus HTTP/1.1 
Host: cochraneplus-api-dev.happen.zone 
Accept: text/jsonl
Content-Type: text/jsonl
Content-Length: length

{"attendanceSessionId":0,"eventType":0,"timeZoneName":"String","apiKey":"String","latitude":0,"longitude":0}
HTTP/1.1 200 OK
Content-Type: text/jsonl
Content-Length: length

{"sessionInfo":{"attendanceSessionId":0,"attendanceGoalTime":0,"attendanceGoalTimeValue":"00:00:00","attendanceEvents":[{}],"startDate":"String","endDate":"String","isClockedIn":false,"timeElapsed":0,"latestEventType":0,"totalBreakTime":0,"totalLunchTime":0,"isNew":false},"description":"String","heading":"String","wasSuccessful":false,"modelState":{}}