| 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 .xml suffix or ?format=xml
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: application/xml
Content-Type: application/xml
Content-Length: length
<BackgroundLocationReceived xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.datacontract.org/2004/07/WebService.ServiceModel">
<ApiKey>String</ApiKey>
<location>
<activity>
<confidence>0</confidence>
<type>String</type>
</activity>
<battery>
<is_charging>false</is_charging>
<level>0</level>
</battery>
<coords>
<accuracy>0</accuracy>
<altitude>0</altitude>
<heading>0</heading>
<latitude>0</latitude>
<longitude>0</longitude>
<speed>0</speed>
</coords>
<extras>
<deviceId>00000000-0000-0000-0000-000000000000</deviceId>
<systemUserId>0</systemUserId>
</extras>
<is_moving>false</is_moving>
<odometer>0</odometer>
<timestamp>0001-01-01T00:00:00</timestamp>
<uuid>String</uuid>
</location>
</BackgroundLocationReceived>
HTTP/1.1 200 OK Content-Type: application/xml Content-Length: length <ApiServiceResponse xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.datacontract.org/2004/07/CommonService.Api.Models.Base"> <Description>String</Description> <Heading>String</Heading> <ModelState /> <WasSuccessful>false</WasSuccessful> </ApiServiceResponse>