Cochrane+ App API

<back to all web services

UserLogin

The following routes are available for this service:
POST/user/login
import java.math.*;
import java.util.*;
import net.servicestack.client.*;

public class dtos
{

    public static class UserLogin extends ApiServiceRequest
    {
        public String username = null;
        public String password = null;
        public Integer utcOffset = null;
        
        public String getUsername() { return username; }
        public UserLogin setUsername(String value) { this.username = value; return this; }
        public String getPassword() { return password; }
        public UserLogin setPassword(String value) { this.password = value; return this; }
        public Integer getUtcOffset() { return utcOffset; }
        public UserLogin setUtcOffset(Integer value) { this.utcOffset = value; return this; }
    }

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

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

        /**
        * Longitude of the user making this request
        */
        @ApiMember(DataType="double", Description="Longitude of the user making this request")
        public Double longitude = null;
        
        public String getApiKey() { return apiKey; }
        public ApiServiceRequest setApiKey(String value) { this.apiKey = value; return this; }
        public Double getLatitude() { return latitude; }
        public ApiServiceRequest setLatitude(Double value) { this.latitude = value; return this; }
        public Double getLongitude() { return longitude; }
        public ApiServiceRequest setLongitude(Double value) { this.longitude = value; return this; }
    }

    public static class UserLoginResponse extends ApiServiceResponse
    {
        public Boolean allowAttendanceOnLaptop = null;
        public String profileImageUrl = null;
        public String friendlyName = null;
        public Integer systemUserId = null;
        public String username = null;
        public SystemUserPermission permissions = null;
        public AppSettings settings = null;
        public Double startLatitude = null;
        public Double startLongitude = null;
        public Boolean hasStartLocation = null;
        public Double endLatitude = null;
        public Double endLongitude = null;
        public Boolean hasEndLocation = null;
        public Boolean isSalesPerson = null;
        public ArrayList<String> feelingStatusMappings = null;
        public Boolean hasAiPermissions = null;
        public String refreshToken = null;
        public Boolean isManagerOrPromotedTo = null;
        public Boolean isTemplateApprover = null;
        public Integer outstandingApprovals = null;
        
        public Boolean isAllowAttendanceOnLaptop() { return allowAttendanceOnLaptop; }
        public UserLoginResponse setAllowAttendanceOnLaptop(Boolean value) { this.allowAttendanceOnLaptop = value; return this; }
        public String getProfileImageUrl() { return profileImageUrl; }
        public UserLoginResponse setProfileImageUrl(String value) { this.profileImageUrl = value; return this; }
        public String getFriendlyName() { return friendlyName; }
        public UserLoginResponse setFriendlyName(String value) { this.friendlyName = value; return this; }
        public Integer getSystemUserId() { return systemUserId; }
        public UserLoginResponse setSystemUserId(Integer value) { this.systemUserId = value; return this; }
        public String getUsername() { return username; }
        public UserLoginResponse setUsername(String value) { this.username = value; return this; }
        public SystemUserPermission getPermissions() { return permissions; }
        public UserLoginResponse setPermissions(SystemUserPermission value) { this.permissions = value; return this; }
        public AppSettings getSettings() { return settings; }
        public UserLoginResponse setSettings(AppSettings value) { this.settings = value; return this; }
        public Double getStartLatitude() { return startLatitude; }
        public UserLoginResponse setStartLatitude(Double value) { this.startLatitude = value; return this; }
        public Double getStartLongitude() { return startLongitude; }
        public UserLoginResponse setStartLongitude(Double value) { this.startLongitude = value; return this; }
        public Boolean isHasStartLocation() { return hasStartLocation; }
        public UserLoginResponse setHasStartLocation(Boolean value) { this.hasStartLocation = value; return this; }
        public Double getEndLatitude() { return endLatitude; }
        public UserLoginResponse setEndLatitude(Double value) { this.endLatitude = value; return this; }
        public Double getEndLongitude() { return endLongitude; }
        public UserLoginResponse setEndLongitude(Double value) { this.endLongitude = value; return this; }
        public Boolean isHasEndLocation() { return hasEndLocation; }
        public UserLoginResponse setHasEndLocation(Boolean value) { this.hasEndLocation = value; return this; }
        public Boolean getIsSalesPerson() { return isSalesPerson; }
        public UserLoginResponse setIsSalesPerson(Boolean value) { this.isSalesPerson = value; return this; }
        public ArrayList<String> getFeelingStatusMappings() { return feelingStatusMappings; }
        public UserLoginResponse setFeelingStatusMappings(ArrayList<String> value) { this.feelingStatusMappings = value; return this; }
        public Boolean isHasAiPermissions() { return hasAiPermissions; }
        public UserLoginResponse setHasAiPermissions(Boolean value) { this.hasAiPermissions = value; return this; }
        public String getRefreshToken() { return refreshToken; }
        public UserLoginResponse setRefreshToken(String value) { this.refreshToken = value; return this; }
        public Boolean getIsManagerOrPromotedTo() { return isManagerOrPromotedTo; }
        public UserLoginResponse setIsManagerOrPromotedTo(Boolean value) { this.isManagerOrPromotedTo = value; return this; }
        public Boolean getIsTemplateApprover() { return isTemplateApprover; }
        public UserLoginResponse setIsTemplateApprover(Boolean value) { this.isTemplateApprover = value; return this; }
        public Integer getOutstandingApprovals() { return outstandingApprovals; }
        public UserLoginResponse setOutstandingApprovals(Integer value) { this.outstandingApprovals = value; return this; }
    }

    public static class ApiServiceResponse implements IServiceResponse
    {
        public String description = null;
        public String heading = null;
        public Boolean wasSuccessful = null;
        public Object modelState = null;
        
        public String getDescription() { return description; }
        public ApiServiceResponse setDescription(String value) { this.description = value; return this; }
        public String getHeading() { return heading; }
        public ApiServiceResponse setHeading(String value) { this.heading = value; return this; }
        public Boolean isWasSuccessful() { return wasSuccessful; }
        public ApiServiceResponse setWasSuccessful(Boolean value) { this.wasSuccessful = value; return this; }
        public Object getModelState() { return modelState; }
        public ApiServiceResponse setModelState(Object value) { this.modelState = value; return this; }
    }

    public static class SystemUserPermission
    {
        public Boolean meeting = null;
        public Boolean journey = null;
        public Boolean attendance = null;
        public Boolean notificationCenter = null;
        public Boolean internalRating = null;
        public Boolean debrief = null;
        public Boolean thunderBoltActions = null;
        public Boolean onTheMove = null;
        
        public Boolean isMeeting() { return meeting; }
        public SystemUserPermission setMeeting(Boolean value) { this.meeting = value; return this; }
        public Boolean isJourney() { return journey; }
        public SystemUserPermission setJourney(Boolean value) { this.journey = value; return this; }
        public Boolean isAttendance() { return attendance; }
        public SystemUserPermission setAttendance(Boolean value) { this.attendance = value; return this; }
        public Boolean isNotificationCenter() { return notificationCenter; }
        public SystemUserPermission setNotificationCenter(Boolean value) { this.notificationCenter = value; return this; }
        public Boolean isInternalRating() { return internalRating; }
        public SystemUserPermission setInternalRating(Boolean value) { this.internalRating = value; return this; }
        public Boolean isDebrief() { return debrief; }
        public SystemUserPermission setDebrief(Boolean value) { this.debrief = value; return this; }
        public Boolean isThunderBoltActions() { return thunderBoltActions; }
        public SystemUserPermission setThunderBoltActions(Boolean value) { this.thunderBoltActions = value; return this; }
        public Boolean isOnTheMove() { return onTheMove; }
        public SystemUserPermission setOnTheMove(Boolean value) { this.onTheMove = value; return this; }
    }

    public static class AppSettings
    {
        public Boolean allowAbstainRatings = null;
        public Boolean showMoodIndicatorOnApp = null;
        public Boolean takePhotoForAnalysis = null;
        
        public Boolean isAllowAbstainRatings() { return allowAbstainRatings; }
        public AppSettings setAllowAbstainRatings(Boolean value) { this.allowAbstainRatings = value; return this; }
        public Boolean isShowMoodIndicatorOnApp() { return showMoodIndicatorOnApp; }
        public AppSettings setShowMoodIndicatorOnApp(Boolean value) { this.showMoodIndicatorOnApp = value; return this; }
        public Boolean isTakePhotoForAnalysis() { return takePhotoForAnalysis; }
        public AppSettings setTakePhotoForAnalysis(Boolean value) { this.takePhotoForAnalysis = value; return this; }
    }

}

Java UserLogin 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.

POST /user/login HTTP/1.1 
Host: cochraneplus-api-dev.happen.zone 
Accept: application/xml
Content-Type: application/xml
Content-Length: length

<UserLogin xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.datacontract.org/2004/07/WebService.ServiceModel">
  <ApiKey xmlns="http://schemas.datacontract.org/2004/07/WebService.ServiceModel.Base">String</ApiKey>
  <Latitude xmlns="http://schemas.datacontract.org/2004/07/WebService.ServiceModel.Base">0</Latitude>
  <Longitude xmlns="http://schemas.datacontract.org/2004/07/WebService.ServiceModel.Base">0</Longitude>
  <Password>String</Password>
  <Username>String</Username>
  <UtcOffset>0</UtcOffset>
</UserLogin>
HTTP/1.1 200 OK
Content-Type: application/xml
Content-Length: length

<UserLoginResponse xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.datacontract.org/2004/07/WebService.ServiceModel">
  <Description xmlns="http://schemas.datacontract.org/2004/07/CommonService.Api.Models.Base">String</Description>
  <Heading xmlns="http://schemas.datacontract.org/2004/07/CommonService.Api.Models.Base">String</Heading>
  <ModelState xmlns="http://schemas.datacontract.org/2004/07/CommonService.Api.Models.Base" />
  <WasSuccessful xmlns="http://schemas.datacontract.org/2004/07/CommonService.Api.Models.Base">false</WasSuccessful>
  <AllowAttendanceOnLaptop>false</AllowAttendanceOnLaptop>
  <EndLatitude>0</EndLatitude>
  <EndLongitude>0</EndLongitude>
  <FeelingStatusMappings xmlns:d2p1="http://schemas.microsoft.com/2003/10/Serialization/Arrays">
    <d2p1:string>String</d2p1:string>
  </FeelingStatusMappings>
  <FriendlyName>String</FriendlyName>
  <HasAiPermissions>false</HasAiPermissions>
  <IsManagerOrPromotedTo>false</IsManagerOrPromotedTo>
  <IsSalesPerson>false</IsSalesPerson>
  <IsTemplateApprover>false</IsTemplateApprover>
  <OutstandingApprovals>0</OutstandingApprovals>
  <Permissions xmlns:d2p1="http://schemas.datacontract.org/2004/07/BusinessLogic.Entities">
    <d2p1:Attendance>false</d2p1:Attendance>
    <d2p1:Debrief>false</d2p1:Debrief>
    <d2p1:InternalRating>false</d2p1:InternalRating>
    <d2p1:Journey>false</d2p1:Journey>
    <d2p1:Meeting>false</d2p1:Meeting>
    <d2p1:NotificationCenter>false</d2p1:NotificationCenter>
    <d2p1:OnTheMove>false</d2p1:OnTheMove>
    <d2p1:ThunderBoltActions>false</d2p1:ThunderBoltActions>
  </Permissions>
  <ProfileImageUrl>String</ProfileImageUrl>
  <RefreshToken>String</RefreshToken>
  <Settings>
    <AllowAbstainRatings>false</AllowAbstainRatings>
    <ShowMoodIndicatorOnApp>false</ShowMoodIndicatorOnApp>
    <TakePhotoForAnalysis>false</TakePhotoForAnalysis>
  </Settings>
  <StartLatitude>0</StartLatitude>
  <StartLongitude>0</StartLongitude>
  <SystemUserId>0</SystemUserId>
  <Username>String</Username>
</UserLoginResponse>