(Quick Reference)

19 Check-in List - Reference Documentation

Version: 2.1

Table of Contents

19 Check-in List

19.1 List

Service: List of check-in

Description: This web service return the list of check-in data in JSON Format

URL:

https://BASE_URL/api/VERSION/checkIns

Method: GET

Parameters:

Pagination parameters:

NameDescriptionTypeRequiredPossible values
offsetTells where to start returning records from the entire set of resultsIntegerNo 
maxlimits the number of resources requested to returnIntegerNo 
sortOrders the results by the specified fieldStringNo 
orderOrders ascending (ASC) or descending DESCIntegerNoasc, desc

Filters parameters:

NameDescriptionTypeRequiredExample values
dateCreated_gtFilters by the resource's creation date time and operator greater thanDateno2016-08-15T14:52:48Z
dateCreated_gteFilters by the resource's creation date time and operator greater than or equalDateno 
dateCreated_ltFilters by the resource's creation date time and operator less thanDateno 
dateCreated_lteFilters by the resource's creation date time and operator less than or equalDateno 
lastUpdated_gtFilters by the resource's last-modified date time and operator greater thanDateno 
lastUpdated_gteFilters by the resource's last-modified date time and operator greater than or equalDateno 
lastUpdated_ltFilters by the resource's last-modified date time and operator less thanDateno 
lastUpdated_lteFilters by the resource's last-modified date time and operator less than or equalDateno 
startDate_gtFilters by the resource's start check-In date time and operator greater thanDateno 
startDate_gteFilters by the resource's start check-In date time and operator greater than or equalDateno 
startDate_ltFilters by the resource's start check-In date time and operator less thanDateno 
startDate_lteFilters by the resource's start check-In date time and operator less than or equalDateno 
endDate_gtFilters by the resource's end check-out date time and operator greater thanDateno 
endDate_gteFilters by the resource's end check-out date time and operator greater than or equalDateno 
endDate_ltFilters by the resource's end check-out date time and operator less thanDateno 
endDate_lteFilters by the resource's end check-out date time and operator less than or equalDateno 
customerReferenceWildcard search by the resource's customer referenceStringnocustomerReference=Ref-6* , customerReference=*ef-6 , customerReference=*ef-6*
employeeReferenceWildcard search by the resource's emoloyee referenceStringnoemployeeReference=Ref-6* , employeeReference=*ef-6 , employeeReference=*ef-6*
visitRankrank of visit of customerIntegerno 
typecheck-In typeStringnoinside , outside
isSureit represent confirmation of the declared new position of the customerBooleannofalse , true
Dates should be formatted as the ISO-8601 format (YYYY-MM-DDTHH:MM:SSZ)

When type value equal to inside it means the check-in is done inside customer GPS position. When type value equal to outside it means the check-in is done outside customer GPS position.

isSure value is set to true when check-in is outside however we are inside customer.

Success Output

Success case: response.status=200

{
  "paging": {
    "total": 3,
    "max": 100,
    "offset": 0,
    "previous": null,
    "next": null
  },
  "data": [
    {
      "id": 8,
      "visitRank": 1,
      "startDate": "2016-02-20T14:00:00Z",
      "endDate": "2016-02-20T14:30:00Z",
      "type": "inside",
      "latitude": 36.856,
      "longitude": 10.195,
      "customerLatitude": 36.856,
      "customerLongitude": 10.195,
      "distance": null,
      "isSure": null,
      "editable": true,
      "routeId": 1,
      "reason": null,
      "user": {
        "id": 3,
        "href": "/api/v1.0/users/3"
      },
      "customer": {
        "id": 2,
        "href": "/api/v1.0/customers/2"
      },
      "organization": "entity1",
      "dateCreated": "2016-10-03T15:24:12Z",
      "lastUpdated": "2016-10-03T15:24:12Z"
    },
    {
      "id": 9,
      "visitRank": 2,
      "startDate": "2016-02-20T17:00:00Z",
      "endDate": "2016-02-20T18:30:00Z",
      "type": "outside",
      "latitude": 36.81328,
      "longitude": 10.1331903,
      "customerLatitude": 36.8561473,
      "customerLongitude": 10.1953111,
      "distance": 9256,
      "isSure": true,
      "editable": true,
      "routeId": 1,
      "reason": null,
      "user": {
        "id": 3,
        "href": "/api/v1.0/users/3"
      },
      "customer": {
        "id": 3,
        "href": "/api/v1.0/customers/3"
      },
      "organization": "entity1",
      "dateCreated": "2016-10-03T15:24:29Z",
      "lastUpdated": "2016-10-03T15:24:29Z"
    },
    {
      "id": 10,
      "visitRank": 3,
      "startDate": "2016-02-20T21:00:00Z",
      "endDate": null,
      "type": "outside",
      "latitude": 43.7111496,
      "longitude": 7.1947483,
      "customerLatitude": 43.7254711,
      "customerLongitude": 7.2848838,
      "distance": 15206,
      "isSure": false,
      "editable": true,
      "routeId": 1,
      "reason": null,
      "user": {
        "id": 3,
        "href": "/api/v1.0/users/3"
      },
      "customer": {
        "id": 3,
        "href": "/api/v1.0/customers/3"
      },
      "organization": "entity1",
      "dateCreated": "2016-10-03T15:26:59Z",
      "lastUpdated": "2016-10-03T15:26:59Z"
    }
  ]
}

Failure Output

Failure case:response.status = 400
{
   "error": "invalid_param",
   "error_description": "The parameters [dateCreated_gta] you provided are not valid for this request."
}
{
    "error": "invalid_datetime_format",
    "error_description": "Invalid datetime filter (not ISO-8601 formatted): [2016-08-1Z]"
}

Failure case:response.status = 500
{
   "error": "server_error",
   "error_description": "Oops! Something went wrong..."
}

19.2 Show

Service: Show a check-in data

Description: This web service return an existing check-in object of the specified id in JSON format

URL:

https://BASE_URL/api/VERSION/checkIns/{id}

Method: GET

Parameters:

NameDescriptionTypeRequiredExample values
idid of the desired check-inLongYes777

Success Output

Success case: response.status=200
{
  "id": 8,
  "visitRank": 1,
  "startDate": "2016-02-20T14:00:00Z",
  "endDate": "2016-02-20T14:30:00Z",
  "type": "outside",
  "latitude": 36.8561473,
  "longitude": 10.1953111,
  "customerLatitude": 35.83221109,
  "customerLongitude": 10.6366781,
  "distance": 154876,
  "isSure": true,
  "editable": true,
  "routeId": 1,
  "reason": null,
  "user": {
    "id": 3,
    "href": "/api/v1.0/users/3"
  },
  "customer": {
    "id": 2,
    "href": "/api/v1.0/customers/2"
  },
  "organization": "entity1",
  "dateCreated": "2016-10-03T15:24:12Z",
  "lastUpdated": "2016-10-03T15:24:12Z"
}

Failure Output

Failure case:response.status = 400
{
    "error": "invalid_param_type",
    "error_description": "The type of parameter id you provided is not valid for this request."
}

Failure case:response.status = 404
{
    "error": "not_found",
    "error_description": "The check-in with the id 5 doesn't exist."
}