| POST | /user/login |
|---|
"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;
}
export class SystemUserPermission {
/** @param {{meeting?:boolean,journey?:boolean,attendance?:boolean,notificationCenter?:boolean,internalRating?:boolean,debrief?:boolean,thunderBoltActions?:boolean,onTheMove?:boolean}} [init] */
constructor(init) { Object.assign(this, init) }
/** @type {boolean} */
meeting;
/** @type {boolean} */
journey;
/** @type {boolean} */
attendance;
/** @type {boolean} */
notificationCenter;
/** @type {boolean} */
internalRating;
/** @type {boolean} */
debrief;
/** @type {boolean} */
thunderBoltActions;
/** @type {boolean} */
onTheMove;
}
export class AppSettings {
/** @param {{allowAbstainRatings?:boolean,showMoodIndicatorOnApp?:boolean,takePhotoForAnalysis?:boolean}} [init] */
constructor(init) { Object.assign(this, init) }
/** @type {boolean} */
allowAbstainRatings;
/** @type {boolean} */
showMoodIndicatorOnApp;
/** @type {boolean} */
takePhotoForAnalysis;
}
export class UserLoginResponse extends ApiServiceResponse {
/** @param {{allowAttendanceOnLaptop?:boolean,profileImageUrl?:string,friendlyName?:string,systemUserId?:number,username?:string,permissions?:SystemUserPermission,settings?:AppSettings,startLatitude?:number,startLongitude?:number,hasStartLocation?:boolean,endLatitude?:number,endLongitude?:number,hasEndLocation?:boolean,isSalesPerson?:boolean,feelingStatusMappings?:string[],hasAiPermissions?:boolean,refreshToken?:string,isManagerOrPromotedTo?:boolean,isTemplateApprover?:boolean,outstandingApprovals?:number,description?:string,heading?:string,wasSuccessful?:boolean,modelState?:Object}} [init] */
constructor(init) { super(init); Object.assign(this, init) }
/** @type {boolean} */
allowAttendanceOnLaptop;
/** @type {string} */
profileImageUrl;
/** @type {string} */
friendlyName;
/** @type {number} */
systemUserId;
/** @type {string} */
username;
/** @type {SystemUserPermission} */
permissions;
/** @type {AppSettings} */
settings;
/** @type {number} */
startLatitude;
/** @type {number} */
startLongitude;
/** @type {boolean} */
hasStartLocation;
/** @type {number} */
endLatitude;
/** @type {number} */
endLongitude;
/** @type {boolean} */
hasEndLocation;
/** @type {boolean} */
isSalesPerson;
/** @type {string[]} */
feelingStatusMappings;
/** @type {boolean} */
hasAiPermissions;
/** @type {string} */
refreshToken;
/** @type {boolean} */
isManagerOrPromotedTo;
/** @type {boolean} */
isTemplateApprover;
/** @type {number} */
outstandingApprovals;
}
export class UserLogin extends ApiServiceRequest {
/** @param {{username?:string,password?:string,utcOffset?:number,apiKey?:string,latitude?:number,longitude?:number}} [init] */
constructor(init) { super(init); Object.assign(this, init) }
/** @type {string} */
username;
/** @type {string} */
password;
/** @type {number} */
utcOffset;
}
To override the Content-type in your clients, use the HTTP Accept Header, append the .jsv suffix or ?format=jsv
The following are sample HTTP requests and responses. The placeholders shown need to be replaced with actual values.
POST /user/login HTTP/1.1
Host: cochraneplus-api-dev.happen.zone
Accept: text/jsv
Content-Type: text/jsv
Content-Length: length
{
username: String,
password: String,
utcOffset: 0,
apiKey: String,
latitude: 0,
longitude: 0
}
HTTP/1.1 200 OK
Content-Type: text/jsv
Content-Length: length
{
allowAttendanceOnLaptop: False,
profileImageUrl: String,
friendlyName: String,
systemUserId: 0,
username: String,
permissions:
{
meeting: False,
journey: False,
attendance: False,
notificationCenter: False,
internalRating: False,
debrief: False,
thunderBoltActions: False,
onTheMove: False
},
settings:
{
allowAbstainRatings: False,
showMoodIndicatorOnApp: False,
takePhotoForAnalysis: False
},
startLatitude: 0,
startLongitude: 0,
hasStartLocation: False,
endLatitude: 0,
endLongitude: 0,
hasEndLocation: False,
isSalesPerson: False,
feelingStatusMappings:
[
String
],
hasAiPermissions: False,
refreshToken: String,
isManagerOrPromotedTo: False,
isTemplateApprover: False,
outstandingApprovals: 0,
description: String,
heading: String,
wasSuccessful: False,
modelState: {}
}