Cochrane+ App API

<back to all web services

BackgroundLocationReceived

The following routes are available for this service:
POST/location/background
BackgroundLocationReceived Parameters:
NameParameterData TypeRequiredDescription
ApiKeybodystringNo
locationbodyLocationDataNo
LocationData Parameters:
NameParameterData TypeRequiredDescription
coordsformCoordsDataNo
extrasformExtrasDataNo
is_movingformboolNo
odometerformdoubleNo
uuidformstringNo
activityformActivityDataNo
batteryformBatteryDataNo
timestampformDateTimeNo
CoordsData Parameters:
NameParameterData TypeRequiredDescription
speedformdoubleNo
longitudeformdoubleNo
latitudeformdoubleNo
accuracyformdoubleNo
altitudeformdoubleNo
headingformdoubleNo
ExtrasData Parameters:
NameParameterData TypeRequiredDescription
systemUserIdformintNo
deviceIdformGuidNo
ActivityData Parameters:
NameParameterData TypeRequiredDescription
typeformstringNo
confidenceformintNo
BatteryData Parameters:
NameParameterData TypeRequiredDescription
levelformdoubleNo
is_chargingformboolNo
ApiServiceResponse Parameters:
NameParameterData TypeRequiredDescription
DescriptionformstringNo
HeadingformstringNo
WasSuccessfulformboolNo
ModelStateformObjectNo

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 /location/background HTTP/1.1 
Host: cochraneplus-api-dev.happen.zone 
Accept: text/jsv
Content-Type: text/jsv
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-01
	}
}
HTTP/1.1 200 OK
Content-Type: text/jsv
Content-Length: length

{
	description: String,
	heading: String,
	wasSuccessful: False,
	modelState: {}
}