{"metadata":{"image":[],"title":"","description":""},"api":{"url":"/users/shift/capture.json","auth":"required","examples":{"codes":[]},"method":"post","params":[{"name":"eventTime","type":"int","default":"","desc":"Timestamp (in milliseconds) during which the shift was created","required":true,"in":"body","ref":"","_id":"57330e0c45fc0c0e00c15403"},{"name":"eventType","type":"int","default":"","desc":"Type of events separated by comma. The following values are valid: 1 - Shift start , 2 - Break start, 3 - Break End, 4 - Shift End","required":true,"in":"body","ref":"","_id":"57330e0c45fc0c0e00c15402"},{"name":"accuracy","type":"double","default":"","desc":"Precision of the location point","required":false,"in":"body","ref":"","_id":"57330e0c45fc0c0e00c15401"},{"name":"address","type":"object","default":"","desc":"Specifies the address of the shift location","required":false,"in":"body","ref":"","_id":"57330e0c45fc0c0e00c15400"},{"name":"city","type":"string","default":"","desc":"City of the shift location","required":false,"in":"body","ref":"","_id":"57330e0c45fc0c0e00c153ff"},{"name":"country","type":"string","default":"","desc":"Country of the shift location","required":false,"in":"body","ref":"","_id":"57330e0c45fc0c0e00c153fe"},{"name":"formattedAddress","type":"string","default":"","desc":"Concatenated string containing the complete address of the shift location","required":false,"in":"body","ref":"","_id":"57330e0c45fc0c0e00c153fd"},{"name":"state","type":"string","default":"","desc":"State of the shift location","required":false,"in":"body","ref":"","_id":"57330e0c45fc0c0e00c153fc"},{"name":"zip","type":"string","default":"","desc":"Postal code of the shift location","required":false,"in":"body","ref":"","_id":"57330e0c45fc0c0e00c153fb"},{"name":"altitude","type":"double","default":"","desc":"Altitude or elevation of the shift location","required":false,"in":"body","ref":"","_id":"57330e0c45fc0c0e00c153fa"},{"name":"bearing","type":"double","default":"","desc":"Used for navigation and direction","required":false,"in":"body","ref":"","_id":"57330e0c45fc0c0e00c153f9"},{"name":"latitude","type":"double","default":"","desc":"Latitude coordinates of the shift location","required":false,"in":"body","ref":"","_id":"57330e0c45fc0c0e00c153f8"},{"name":"longitude","type":"double","default":"","desc":"Longitude coordinates of the shift location","required":false,"in":"body","ref":"","_id":"57330e0c45fc0c0e00c153f7"},{"name":"speed","type":"double","default":"","desc":"Speed of the vehicle which is tracked","required":false,"in":"body","ref":"","_id":"57330e0c45fc0c0e00c153f6"},{"name":"time","type":"string","default":"","desc":"Address generation timestamp in milliseconds","required":false,"in":"body","ref":"","_id":"57330e0c45fc0c0e00c153f5"},{"name":"misc","type":"string","default":"","desc":"Additional information about the shift activity","required":false,"in":"body","ref":"","_id":"57330e0c45fc0c0e00c153f4"}],"results":{"codes":[{"status":200,"language":"json","code":"{  \n   \"timeCardFeed\":{  \n      \"code\":200,\n      \"message\":\"Success\",\n      \"generatedAtInMillis\":1461216235877,\n      \"shiftId\":21\n   }\n}\n","name":""}]},"settings":"559288b86bf22f170075b794"},"next":{"description":"","pages":[]},"title":"Create","type":"endpoint","slug":"create-shift","excerpt":"This API allows you to create new shifts for a driver present in your account.  You can create shifts only for those drivers to whom you have access to and provided you have the privilege to do so. Along with creating a shift, this API also generates a unique shift ID for that shift. This ID will serve as a reference while making API calls for viewing, updating and deleting activities related to this shift.","body":"[block:callout]\n{\n  \"type\": \"info\",\n  \"title\": \"Sample Request\",\n  \"body\": \"https://api.azuga.com/azuga-ws/v1/users/shift/capture.json\"\n}\n[/block]\n\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"{  \\n   \\\"eventTime\\\":1459051800000,\\n   \\\"eventType\\\":1,\\n   \\\"location\\\":{  \\n      \\\"accuracy\\\":75.0,\\n      \\\"address\\\":{  \\n         \\\"city\\\":\\\"San Jose\\\",\\n         \\\"country\\\":\\\"USA\\\",\\n         \\\"formattedAddress\\\":\\\"132,Lakeshore Circle, San Jose, California, USA 95131\\\",\\n         \\\"state\\\":\\\"California\\\",\\n         \\\"zip\\\":\\\"95131\\\"\\n      },\\n      \\\"altitude\\\":-1.0,\\n      \\\"bearing\\\":-1.0,\\n      \\\"latitude\\\":37.385698,\\n      \\\"longitude\\\":-121.894093,\\n      \\\"speed\\\":-1.0,\\n      \\\"time\\\":1456278813000\\n   }\\n“misc”:  “Starting shift”\\n}\\n\",\n      \"language\": \"json\",\n      \"name\": \"Sample Payload\"\n    }\n  ]\n}\n[/block]\n##API Response Explanation\n[block:parameters]\n{\n  \"data\": {\n    \"h-0\": \"Field\",\n    \"h-1\": \"Description\",\n    \"0-0\": \"code\",\n    \"1-0\": \"message\",\n    \"2-0\": \"generatedAtInMillis\",\n    \"3-0\": \"shiftId\",\n    \"0-1\": \"API Status Code\",\n    \"1-1\": \"API Message (Success/Failure)\",\n    \"2-1\": \"API generation timestamp in UTC\",\n    \"3-1\": \"Unique identifier of the shift\"\n  },\n  \"cols\": 2,\n  \"rows\": 4\n}\n[/block]","updates":[],"order":0,"isReference":true,"hidden":false,"sync_unique":"","link_url":"","link_external":false,"_id":"57330e0c45fc0c0e00c153f3","user":"5656a3dd5656350d001d83a0","version":{"version":"1","version_clean":"1.0.0","codename":"","is_stable":true,"is_beta":false,"is_hidden":false,"is_deprecated":false,"categories":["559286c7c39c4b2d00127a72","55928a98c39c4b2d00127a83","5592bd7b9a68220d00f1c3db","5593dcaf0e82e81700334e25","5594342f0c33bd0d000595a3","563081713998420d00a509e4","5630941c7581b80d00c51c86","56309f4ff1c0580d00fac666","567923b8239fac0d00c7df25","573306dea6a9c40e00e13875","577a288fd051530e00f65563","579af3982b865e17005a4357","57ee06aa1e42900e0014a374","5951f49a63f39000159e7ef1","5951f4c563f39000159e7ef2","598951542a9dfc000fcacd40","5b3375cc98cb500003e4b363","5bbcd4e29667280003084100"],"_id":"559286c6c39c4b2d00127a71","createdAt":"2015-06-30T12:08:38.768Z","project":"55926c913735880d005f7c65","releaseDate":"2015-06-30T12:08:38.768Z","__v":18,"forked_from":"559286b6c39c4b2d00127a6e"},"createdAt":"2016-05-11T10:48:44.162Z","editedParams":true,"githubsync":"","project":"55926c913735880d005f7c65","editedParams2":true,"parentDoc":null,"__v":1,"category":{"sync":{"isSync":false,"url":""},"pages":[],"title":"TIMECARD","slug":"timecard","order":10,"from_sync":false,"reference":true,"_id":"573306dea6a9c40e00e13875","version":"559286c6c39c4b2d00127a71","project":"55926c913735880d005f7c65","createdAt":"2016-05-11T10:18:06.559Z","__v":0}}

postCreate

This API allows you to create new shifts for a driver present in your account. You can create shifts only for those drivers to whom you have access to and provided you have the privilege to do so. Along with creating a shift, this API also generates a unique shift ID for that shift. This ID will serve as a reference while making API calls for viewing, updating and deleting activities related to this shift.

Definition

{{ api_url }}{{ page_api_url }}

Parameters

Body Params

eventTime:
required
integer
Timestamp (in milliseconds) during which the shift was created
eventType:
required
integer
Type of events separated by comma. The following values are valid: 1 - Shift start , 2 - Break start, 3 - Break End, 4 - Shift End
accuracy:
double
Precision of the location point
address:
object
Specifies the address of the shift location
city:
string
City of the shift location
country:
string
Country of the shift location
formattedAddress:
string
Concatenated string containing the complete address of the shift location
state:
string
State of the shift location
zip:
string
Postal code of the shift location
altitude:
double
Altitude or elevation of the shift location
bearing:
double
Used for navigation and direction
latitude:
double
Latitude coordinates of the shift location
longitude:
double
Longitude coordinates of the shift location
speed:
double
Speed of the vehicle which is tracked
time:
string
Address generation timestamp in milliseconds
misc:
string
Additional information about the shift activity

Result Format


Documentation

[block:callout] { "type": "info", "title": "Sample Request", "body": "https://api.azuga.com/azuga-ws/v1/users/shift/capture.json" } [/block] [block:code] { "codes": [ { "code": "{ \n \"eventTime\":1459051800000,\n \"eventType\":1,\n \"location\":{ \n \"accuracy\":75.0,\n \"address\":{ \n \"city\":\"San Jose\",\n \"country\":\"USA\",\n \"formattedAddress\":\"132,Lakeshore Circle, San Jose, California, USA 95131\",\n \"state\":\"California\",\n \"zip\":\"95131\"\n },\n \"altitude\":-1.0,\n \"bearing\":-1.0,\n \"latitude\":37.385698,\n \"longitude\":-121.894093,\n \"speed\":-1.0,\n \"time\":1456278813000\n }\n“misc”: “Starting shift”\n}\n", "language": "json", "name": "Sample Payload" } ] } [/block] ##API Response Explanation [block:parameters] { "data": { "h-0": "Field", "h-1": "Description", "0-0": "code", "1-0": "message", "2-0": "generatedAtInMillis", "3-0": "shiftId", "0-1": "API Status Code", "1-1": "API Message (Success/Failure)", "2-1": "API generation timestamp in UTC", "3-1": "Unique identifier of the shift" }, "cols": 2, "rows": 4 } [/block]

User Information

Try It Out

post
{{ tryResults.results }}
Method{{ tryResults.method }}
Request Headers
{{ tryResults.requestHeaders }}
URL{{ tryResults.url }}
Request Data
{{ tryResults.data }}
Status
Response Headers
{{ tryResults.responseHeaders }}