Skip to content

Event API

Subscribe

Send a POST request to http://{IP}:{PORT}/api/v1/webhooks by providing these arguments as application/json.

Argument Example Required Description
type vehicle-counting true type of rule enum: vehicle-classification-plate-event,lpr-event,face-known-event,face-unknown-event
title url for webhook true title of url
url http://handler.example.com/testing true url for event callback (Must with HTTP POST)

Response

HTTP Mapping 201 Created

{
   "ok":true,
   "webhook":{
      "id":2,
      "title":"url for webhook",
      "url":"http://handler@example.com/testing",
      "type":"face-known-event",
      "created_at":"2018-06-04T01:38:28.909Z",
      "updated_at":"2018-06-04T02:01:48.210Z"
   }
}

HTTP Mapping 422 Unprocessable Entity

{
   "ok":false,
   "errors":{
      "content-type":{
         "location":"headers",
         "param":"content-type",
         "msg":"Invalid value"
      },
      "title":{
         "location":"body",
         "param":"title",
         "msg":"Title is required"
      },
      "url":{
         "location":"body",
         "param":"url",
         "msg":"Url is required"
      },
      "type":{
         "location":"body",
         "param":"type",
         "msg":"Type must have either lpr-event,vehicle-classification-plate-event,vehicle-density-event,vehicle-traffic-surveillance-event,vehicle-counting,face-known-event,face-unknown-event,crowd-behaviour-event,crowd-estimation-event,personage-gender-event,person-outfit-event,people-counting-event,vehicle-dwelling-event,people-dwelling-event"
      }
   }
}

Payload

Structure Data to accept the response from webhook. The data structure will be send with method POST, attach in request body with content-type application/json.

License Plate Recognition

{
   "event_type":"lpr-event",
   "timestamp":"2019-02-25 16:34:27.403+07",
   "camera":{
      "address":"",
      "coordinate":[
         -6.17476,
         106.82707
      ],
      "advance_attr":{
         "type":"",
         "attr":{
            "vms_ip":"",
            "password":"",
            "vms_code":"",
            "code":"",
            "user":"",
            "vms_port":""
         }
      },
      "advance":false,
      "name":"Dahua",
      "id":104
   },
   "data":{
      "plate":"B1234XYZ",
      "plate_image":"base64string",
      "owner":{
         "nik":"nik",
         "name":"name"
      },
      "attribute":{
         "type":"type",
         "brand":"brand",
         "color":"color"
      }
   }
}

Vehicle Traffic Surveillance

{
   "event_type":"vehicle-traffic-surveillance-event",
   "timestamp":"2019-02-26T03:43:08.195502+00:00",
   "camera":{
      "address":"",
      "coordinate":[
         -6.17476,
         106.82707
      ],
      "advance_attr":{
         "type":"",
         "attr":{
            "vms_ip":"",
            "password":"",
            "vms_code":"",
            "code":"",
            "user":"",
            "vms_port":""
         }
      },
      "advance":false,
      "name":"Dahua",
      "id":104
   },
   "data":{
      "vehicle_type":"motorcycle",
      "plate":"B123EYZ",
      "duration":10,
      "vehicle_image":"base64string",
      "plate_image":"base64string"
   }
}

Vehicle Counting

{
   "event_type":"vehicle-counting-event",
   "timestamp":"2019-02-25 16:34:27.403+07",
   "camera":{
      "address":"",
      "coordinate":[
         -6.17476,
         106.82707
      ],
      "advance_attr":{
         "type":"",
         "attr":{
            "vms_ip":"",
            "password":"",
            "vms_code":"",
            "code":"",
            "user":"",
            "vms_port":""
         }
      },
      "advance":false,
      "name":"Dahua",
      "id":104
   },
   "data":{
      "track_id":1111,
      "detail":"motorcycle",
      "area":"area 1",
      "direction":"in",
      "vehicle_image":"base64string"
   }
}

Face Known

{
   "event_type":"face-known-event",
   "timestamp":"2019-02-25 16:34:27.403+07",
   "camera":{
      "address":"",
      "coordinate":[
         -6.17476,
         106.82707
      ],
      "advance_attr":{
         "type":"",
         "attr":{
            "vms_ip":"",
            "password":"",
            "vms_code":"",
            "code":"",
            "user":"",
            "vms_port":""
         }
      },
      "advance":false,
      "name":"Dahua",
      "id":104
   },
   "data":{
      "identity":"9046532212916224",
      "probability":80.5,
      "face_image":"base64 string",
      "face":{
         "name":"raisa",
         "image":"base64 string",
         "additional_fields":{
            "status":"artis",
            "gender":"female",
            "ttl":"10/01/2018",
            "kewarganegaraan":"indonesia",
            "nik":"2"
         }
      }
   }
}

Face Unknown

{
   "event_type":"face-unknown-event",
   "timestamp":"2019-02-25 16:34:27.403+07",
   "camera":{
      "address":"",
      "coordinate":[
         -6.17476,
         106.82707
      ],
      "advance_attr":{
         "type":"",
         "attr":{
            "vms_ip":"",
            "password":"",
            "vms_code":"",
            "code":"",
            "user":"",
            "vms_port":""
         }
      },
      "advance":false,
      "name":"Dahua",
      "id":104
   },
   "data":{
      "identity":9046532212916224,
      "probability":80.5,
      "face_image":"base64 string"
   }
}

Crowd Estimation

{
   "event_type":"crowd-estimation-event",
   "timestamp":"2019-02-4 11:36:37.877+07",
   "camera":{
      "address":"",
      "coordinate":[
         -6.17476,
         106.82707
      ],
      "advance_attr":{
         "type":"",
         "attr":{
            "vms_ip":"",
            "password":"",
            "vms_code":"",
            "code":"",
            "user":"",
            "vms_port":""
         }
      },
      "advance":false,
      "name":"Dahua",
      "id":104
   },
   "data":{
      "upper_estimate":10,
      "estimate":5,
      "lower_estimate":2,
      "area":"area 1"
   }
}

People Counting

{
   "event_type":"people-counting-event",
   "timestamp":"2019-02-25 16:34:27.403+07",
   "camera":{
      "address":"",
      "coordinate":[
         -6.17476,
         106.82707
      ],
      "advance_attr":{
         "type":"",
         "attr":{
            "vms_ip":"",
            "password":"",
            "vms_code":"",
            "code":"",
            "user":"",
            "vms_port":""
         }
      },
      "advance":false,
      "name":"Dahua",
      "id":104
   },
   "data":{
      "track_id":1111,
      "detail":"person",
      "area":"area 1",
      "direction":"in",
      "vehicle_image":"base64string"
   }
}

Vehicle Dwelling

{
   "event_type":"vehicle-dwelling-event",
   "timestamp":"2019-02-26T03:43:08.195502+00:00",
   "camera":{
      "address":"",
      "coordinate":[
         -6.17476,
         106.82707
      ],
      "advance_attr":{
         "type":"",
         "attr":{
            "vms_ip":"",
            "password":"",
            "vms_code":"",
            "code":"",
            "user":"",
            "vms_port":""
         }
      },
      "advance":false,
      "name":"Dahua",
      "id":104
   },
   "data":{
      "track_id":12345,
      "area":"area 1",
      "duration":5.012454,
      "detail":"motorcycle",
      "vehicle_image":"some base64 string"
   }
}

People Dwelling

{
   "event_type":"people-dwelling-event",
   "timestamp":"2019-02-27 15:36:37.877+07",
   "camera":{
      "address":"",
      "coordinate":[
         -6.17476,
         106.82707
      ],
      "advance_attr":{
         "type":"",
         "attr":{
            "vms_ip":"",
            "password":"",
            "vms_code":"",
            "code":"",
            "user":"",
            "vms_port":""
         }
      },
      "advance":false,
      "name":"Dahua",
      "id":104
   },
   "data":{
      "track_id":2019032709301790000,
      "duration":800,
      "details":"person",
      "area":"area 3",
      "people_image":"base 64"
   }
}

Water Level Detection

{
   "event_type":"water-level-event",
   "timestamp":"2019-02-27 15:36:37.877+07",
   "camera":{
      "address":"",
      "coordinate":[
         -6.17476,
         106.82707
      ],
      "advance_attr":{
         "type":"",
         "attr":{
            "vms_ip":"",
            "password":"",
            "vms_code":"",
            "code":"",
            "user":"",
            "vms_port":""
         }
      },
      "advance":false,
      "name":"Dahua",
      "id":104
   },
   "data":{
      "water_level":"Safe"
   }
}