Cochrane+ App API

<back to all web services

BackgroundLocationReceived

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

public class dtos
{

    public static class BackgroundLocationReceived implements IHasApiKey
    {
        public String apiKey = null;
        public LocationData location = null;
        
        public String getApiKey() { return apiKey; }
        public BackgroundLocationReceived setApiKey(String value) { this.apiKey = value; return this; }
        public LocationData getLocation() { return location; }
        public BackgroundLocationReceived setLocation(LocationData value) { this.location = value; return this; }
    }

    public static class LocationData
    {
        public CoordsData coords = null;
        public ExtrasData extras = null;
        public Boolean is_moving = null;
        public Double odometer = null;
        public String uuid = null;
        public ActivityData activity = null;
        public BatteryData battery = null;
        public Date timestamp = null;
        
        public CoordsData getCoords() { return coords; }
        public LocationData setCoords(CoordsData value) { this.coords = value; return this; }
        public ExtrasData getExtras() { return extras; }
        public LocationData setExtras(ExtrasData value) { this.extras = value; return this; }
        public Boolean getIsMoving() { return is_moving; }
        public LocationData setIsMoving(Boolean value) { this.is_moving = value; return this; }
        public Double getOdometer() { return odometer; }
        public LocationData setOdometer(Double value) { this.odometer = value; return this; }
        public String getUuid() { return uuid; }
        public LocationData setUuid(String value) { this.uuid = value; return this; }
        public ActivityData getActivity() { return activity; }
        public LocationData setActivity(ActivityData value) { this.activity = value; return this; }
        public BatteryData getBattery() { return battery; }
        public LocationData setBattery(BatteryData value) { this.battery = value; return this; }
        public Date getTimestamp() { return timestamp; }
        public LocationData setTimestamp(Date value) { this.timestamp = value; return this; }
    }

    public static class CoordsData
    {
        public Double speed = null;
        public Double longitude = null;
        public Double latitude = null;
        public Double accuracy = null;
        public Double altitude = null;
        public Double heading = null;
        
        public Double getSpeed() { return speed; }
        public CoordsData setSpeed(Double value) { this.speed = value; return this; }
        public Double getLongitude() { return longitude; }
        public CoordsData setLongitude(Double value) { this.longitude = value; return this; }
        public Double getLatitude() { return latitude; }
        public CoordsData setLatitude(Double value) { this.latitude = value; return this; }
        public Double getAccuracy() { return accuracy; }
        public CoordsData setAccuracy(Double value) { this.accuracy = value; return this; }
        public Double getAltitude() { return altitude; }
        public CoordsData setAltitude(Double value) { this.altitude = value; return this; }
        public Double getHeading() { return heading; }
        public CoordsData setHeading(Double value) { this.heading = value; return this; }
    }

    public static class ExtrasData
    {
        public Integer systemUserId = null;
        public UUID deviceId = null;
        
        public Integer getSystemUserId() { return systemUserId; }
        public ExtrasData setSystemUserId(Integer value) { this.systemUserId = value; return this; }
        public UUID getDeviceId() { return deviceId; }
        public ExtrasData setDeviceId(UUID value) { this.deviceId = value; return this; }
    }

    public static class ActivityData
    {
        public String type = null;
        public Integer confidence = null;
        
        public String getType() { return type; }
        public ActivityData setType(String value) { this.type = value; return this; }
        public Integer getConfidence() { return confidence; }
        public ActivityData setConfidence(Integer value) { this.confidence = value; return this; }
    }

    public static class BatteryData
    {
        public Double level = null;
        public Boolean is_charging = null;
        
        public Double getLevel() { return level; }
        public BatteryData setLevel(Double value) { this.level = value; return this; }
        public Boolean getIsCharging() { return is_charging; }
        public BatteryData setIsCharging(Boolean value) { this.is_charging = 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; }
    }

}

Java BackgroundLocationReceived DTOs

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

HTTP + CSV

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

POST /location/background HTTP/1.1 
Host: cochraneplus-api-dev.happen.zone 
Accept: text/csv
Content-Type: text/csv
Content-Length: length

{"apiKey":"String","location":{"coords":{"speed":0,"longitude":0,"latitude":0,"accuracy":0,"altitude":0,"heading":0},"extras":{"systemUserId":0,"deviceId":"00000000-0000-0000-0000-000000000000"},"is_moving":false,"odometer":0,"uuid":"String","activity":{"type":"String","confidence":0},"battery":{"level":0,"is_charging":false},"timestamp":"0001-01-01T00:00:00.0000000"}}
HTTP/1.1 200 OK
Content-Type: text/csv
Content-Length: length

{"description":"String","heading":"String","wasSuccessful":false,"modelState":{}}