Cochrane+ App API

<back to all web services

UserLogin

The following routes are available for this service:
POST/user/login

export class ApiServiceRequest implements IServiceRequest, IHasApiKey, IHasDeviceInfo
{
    /** @description The API Key required for authentication */
    // @ApiMember(DataType="string", Description="The API Key required for authentication", IsRequired=true)
    public apiKey: string;

    /** @description Latitude of the user making this request */
    // @ApiMember(DataType="double", Description="Latitude of the user making this request")
    public latitude: number;

    /** @description Longitude of the user making this request */
    // @ApiMember(DataType="double", Description="Longitude of the user making this request")
    public longitude: number;

    public constructor(init?: Partial<ApiServiceRequest>) { (Object as any).assign(this, init); }
}

export class ApiServiceResponse implements IServiceResponse
{
    public description: string;
    public heading: string;
    public wasSuccessful: boolean;
    public modelState: Object;

    public constructor(init?: Partial<ApiServiceResponse>) { (Object as any).assign(this, init); }
}

export class SystemUserPermission
{
    public meeting: boolean;
    public journey: boolean;
    public attendance: boolean;
    public notificationCenter: boolean;
    public internalRating: boolean;
    public debrief: boolean;
    public thunderBoltActions: boolean;
    public onTheMove: boolean;

    public constructor(init?: Partial<SystemUserPermission>) { (Object as any).assign(this, init); }
}

export class AppSettings
{
    public allowAbstainRatings: boolean;
    public showMoodIndicatorOnApp: boolean;
    public takePhotoForAnalysis: boolean;

    public constructor(init?: Partial<AppSettings>) { (Object as any).assign(this, init); }
}

export class UserLoginResponse extends ApiServiceResponse
{
    public allowAttendanceOnLaptop: boolean;
    public profileImageUrl: string;
    public friendlyName: string;
    public systemUserId: number;
    public username: string;
    public permissions: SystemUserPermission;
    public settings: AppSettings;
    public startLatitude: number;
    public startLongitude: number;
    public hasStartLocation: boolean;
    public endLatitude: number;
    public endLongitude: number;
    public hasEndLocation: boolean;
    public isSalesPerson: boolean;
    public feelingStatusMappings: string[];
    public hasAiPermissions: boolean;
    public refreshToken: string;
    public isManagerOrPromotedTo: boolean;
    public isTemplateApprover: boolean;
    public outstandingApprovals: number;

    public constructor(init?: Partial<UserLoginResponse>) { super(init); (Object as any).assign(this, init); }
}

export class UserLogin extends ApiServiceRequest
{
    public username: string;
    public password: string;
    public utcOffset: number;

    public constructor(init?: Partial<UserLogin>) { super(init); (Object as any).assign(this, init); }
}

TypeScript UserLogin 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 /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: {}
}