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 .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 /attendance/sessionstatus HTTP/1.1 
Host: cochraneplus-api-dev.happen.zone 
Accept: text/jsv
Content-Type: text/jsv
Content-Length: length

{
	attendanceSessionId: 0,
	eventType: 0,
	timeZoneName: String,
	apiKey: String,
	latitude: 0,
	longitude: 0
}
HTTP/1.1 200 OK
Content-Type: text/jsv
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: {}
}