API documentation

Accept/Deny request

PUT /api/car_driver/smart_keys/{request_id}/activate

Include access_token in HTTP header:

Authorization: Bearer 09ba487fc3df...

Description

Using this web service an admin can accept/deny a parking request

Request Parameters

Parameter name Parameter type Description
request_id int id of the request
is_active boolean true if the parking administrator accepts the request
{
  "smart_key": {
    "is_active": "true"
  }
}

Response

Status Code: 200 if OK

{
  "smart_key": {
    "secured_parking_id": 1,
    "name": "My smart park",
    "description": "blabla",
    "is_active": false,
    "start_time": "2015-11-06T15:21:47Z",
    "end_time": "2015-12-06T15:21:47Z",
    "access_command": "20caaa3de4caa5e48f69c487e88e5bd53404e687f95d59204acd1eeedbc2b118bd03",
    "access_points": [
      {
        "access_point": {
          "module_id": 2,
          "mac_address": "00:07:80:15:3A:00"
        }
      }
    ],
    "accepted_by": 1
  }
}
Parameter name Parameter type Description
smart_keys list of objects list of smart keys objects
name string name of the parking
description string Description of the access key invitation or request
access_command string command to be sent in order to open the barrier
start_time DateTime the start time from which the access command will work
end_time DateTime the end time from which the access command will work
access_points list of objects list of access point objects
access_point object object containing information about an access point
module_id int the id of the access point module
secured_parking_id int id of the parking for which the smart key was created
is_active boolean true if the parking is active
mac_address string the mac address of the access point module(must be matched with the address received by bluetooth)
accepted_by int id of the user that accepted the request

Status Code: 404 if there is no request with that id

Status Code: 401 if request not ok