API documentation

Send box logs

POST /api/box_logs

Include access_token in HTTP header:

Authorization: Bearer 09ba487fc3df...

Description

This web service sends all the box logs from the app.
This web service must be called when online and can send all the offline commands that were send

REQUEST PARAMETERS

Parameter name Parameter type Description
box_logs object object containing an array of box logs
box_log object object containing a box log information
fo_user_id int id of the current user
smart_key_id int id of the smart key
equipment_id int module id
type string in/out/control control must be used for battery and time commands
secured_parking_id int secured parking id
command string command received from server
command_decrypted string command after it was decrypted from base64 into byte[] and transformed into string
response string response received from the box
response_decrypted string response received from the box and decrypted into byte[] and transformed into string
offline bool true if the command was send while in offline mode
created_at datetime creation of the box log
point_attributes object (not required) this could be null if there is no location available
{ "box_logs" :
    [{
    "box_log" : 
        {
          "fo_user_id": 1,
          "smart_key_id": 82,
          "equipment_id": 11,
          "secured_parking_id": 67,
          "type": "in",
          "command": "205e32dc97f079cce7b312b4b7ad3a83ec451cb652c1a0cbf49627eb3112c6041f03",
          "command_decrypted": "05b000013017000000000000000000e7",
          "response": "21100d1062d3da4f21d5fb77545a6a0e687903",
          "response_decrypted": "05b000013017000000000000000000e7",
          "offline": false,
          "created_at": "2016-01-15 11:00:00",
          "point_attributes" : 
          {
              "latitude" : 46.669371,
              "longitude" : 23.590072
          }      
        }
    }
]}

Expose Box Logs for third party applications

In case the secured parking allows the exposure of the box logs to third party, the created box logs will be sent as params to a WS that is made available by the third party application. The POST URL must be previously set on the secured parking.

The POST params will have the form of an array of box logs.

[
    {
      "fo_user_id": 1,
      "email": "email@example.com",
      "smart_key_id": 82,
      "equipment_id": 11,
      "secured_parking_id": 67,
      "type": "in",
      "command": null,
      "command_decrypted": null,
      "response": null,
      "response_decrypted": null,
      "offline": false,
      "created_at": "2016-01-15 11:00:00",
      "point_attributes" : 
      {
          "latitude" : 46.669371,
          "longitude" : 23.590072
      }      
    }
]

Response

Status Code: 201 if OK

Status Code: 422 if unprocessable

Status Code: 404 if one id does not exit

Status Code: 401 if request not ok