Sending events as JSON over HTTP

Sending events as JSON over HTTP

Navigate to Settings > Analytic > JSON to setup the integration.

Check Enable JSON sender to enable the integration.

At Type of recognized text select Unicode plate number.

At Protocol version select Version 1.0

Assign unique Sensor ID of your choice.

At Cloud URL add fully qualified listener / receiver URL, e.g. for Limbio Cloud.

Check Multipart screenshot to enable event frame snapshot delivery along with JSON event data in a multi-part request.

Check Send lost recognize event only for to have event data sent only once when license plate leaves the recognition zone (on LP loss). Otherwise multiple events for the same Licence Plate will be sent.

FF JSON Protocol

JSON Fields

Field name


Format / Value



Unsigned int


Counter of packets. Starts from “1”. Counter starts after successful connection or after start of device. It does not matter.




Event timestamp (UTC).

YYYY - year 4 digits

MM - month 2 digits

DD - day 2 digits


HH - hours

MM - minutes

SS - seconds

FFF - milliseconds

+-HHMM - time zone (optional)

All values above are zero-padded.


Unicode string


Plate number in the Unicode translation


ASCII string

DNK | UKR | FRA ...

Country code, ISO 3166, ALPHA3




Recognition confidence level


ASCII string

“new” | “updated” | “lost”

Event type. NumberOk does not send “lost” events.

geotag: {



Json object with

floats as values


Latitude, longitude


ASCII string

“plate” | “mmrcrop” | “vehicle” | “frame”

The kind of attached image: plate only rectangle with plate number, frame - full frame.


ASCII string

“png” | “jpeg” | “bmp”

The type of attached image. HTTP header must use the same type with header

Content-type: image/...


Unsigned long


The size in bytes of attached image, may be zero.



“null” | ”unknown” | ”in” | ”out”

The kind of detected movement against pre-set direction



“null” | ”unknown” | ”up” | ”down”

The kind of detected movement against frame


Unsigned int


Time of image processing, ms


Array of unsigned int

[800, 545, 150, 20]


Coordinates of license plate bounding box upper left corner and its dimensions


Unsigned long long


Internal runtime plate ID


Unicode string


Channel description


ASCII string


The human-readable name of the sender


Unsigned int


Channel number. Starts from 1.

Camera apps set the value to 1 or omit the field.

NumberOk server based app sets the value as per channel configuration.


Unsigned int

Zone number per given channel. Starts from 1.

Camera apps may omit.

JSON example



  "datetime":"20170221 081331000",                                                                                                               






     "lat": 50.418114,

     "lon": 30.476213


  "imageType": "plate",

  "plateImageType": "png",

  "plateImageSize": "0",



  "plateCoordinates":[0, 680, 440, 272],                                                                                                        







JSON validation tool:



Example of C-code for sending events

This example uses cross platform library curl (

Before sending event (JSON data) is saved to file “json_name”.

Image is in lp_image.

Url is in cld.cloud_url.


         CURL *curl;

         CURLcode res;

         struct curl_httppost *formpost=NULL;

         struct curl_httppost *lastptr=NULL;

         std::string cloud_url = "";

         std::string lp_image = "etalon_hd.jpg";

         std::string json_name = "test_json.json";




         /* Fill in the file upload field */



                    CURLFORM_COPYNAME, "event",

                    CURLFORM_FILE, json_name.c_str(),





                    CURLFORM_COPYNAME, "image",

                    CURLFORM_FILE, lp_image.c_str(),



         curl = curl_easy_init();

         curl_easy_setopt(curl, CURLOPT_URL, cloud_url.c_str() );

         curl_easy_setopt(curl, CURLOPT_HTTPPOST, formpost );


         res = curl_easy_perform( curl );


         If (res != CURLE_OK)


             fprintf(stderr, "curl_easy_perform() failed: %s\n",curl_easy_strerror( res ) );






HTTP headers dump

=> Send header, 227 bytes (0xe3)                                                                                                              

0000: POST /ff_post.php HTTP/1.1                                                                                                     

0025: User-Agent: curl/7.35.0                                                                                                                  

003e: Host:                                                                                                                        

0050: Accept: */*                                                                                                                              

005d: Content-Length: 377541                                                                                                                  

0075: Expect: 100-continue                                                                                                                     

008b: Content-Type: multipart/form-data; boundary=--------------------                                                                        

00cb: ----c83536ed0d118f9a                                                                                                                     


<= Recv header, 23 bytes (0x17)                                                                                                               

0000: HTTP/1.1 100 Continue                                                                                                                    

=> Send data, 152 bytes (0x98)                                                                                                                

0000: --------------------------c83536ed0d118f9a                                                                                           

002c: Content-Disposition: form-data; name="event"; filename="14703115                                                                        

006c: 85.json"                                                                                                                                

0076: Content-Type: application/json                                                                                                           


=> Send data, 337 bytes (0x151)                                                                                                                

0000: {"packetCounter":"1","datetime":"20160805 145305000","plateText"                                                                        

0040: :"\u4100\u4100\u3400\u3200\u3900\u3500\u4f00\u4b00","plateCountr                                                                        

0080: y":"UKR","plateConfidence":"0.852113","carState":"new","carMoveD                                                                        

00c0: irection":"IN","timeProcessing":"20","plateCoordinates":[1233, 1                                                                        

0100: 429, 104, 144],"carID":"1","GEOtarget":"Office","sensorProviderI                                                                         

0140: D":"CameraTest2"}                                                                                                                       

=> Send data, 146 bytes (0x92)                                                                                                                 


0002: --------------------------c83536ed0d118f9a                                                                                           

002e: Content-Disposition: form-data; name="image"; filename="etalon_h                                                                        

006e: d.jpg"                                                                                                                               

0076: Content-Type: image/jpeg                                                                                                                


=> Send data, 16384 bytes (0x4000)                                                                                                             

0000: ......JFIF.....H.H.....C........................................                                                                        

0040: ......!........."$".$..........8................................                                                                     

0080: .......J........................!..1AQ"a..2q#B..R......3.$Cb....                                                                        



3f80: f...kq.q{1..).~..(.j.FU..J..K(..E..d.3..|>..cqH.                                                                        

3fc0: ..$..f.Bh..v*.N..P....I#..9........Dc.Z...&.9].....]..#.v%..R...                                                                                                                                                                                       

=> Send data, 48 bytes (0x30)                                                                                                              


0002: --------------------------c83536ed0d118f9a--                                                                                            



Simple php receiver

The following simple receiver may be used with any HTTP server that supports PHP extension.




  $uploaddir = 'log/';                                                                                                                                                                                                                                                                   

   echo "<pre>\n";                                                                                                                                                                                                                                            

   $uploadfile = $uploaddir . basename($_FILES['event']['name']);                                                                                                                                                                                                                             

   if (move_uploaded_file($_FILES['event']['tmp_name'], $uploadfile)) {                                                                       

     echo "File json uploaded.\n";                                                                                                      

   } else {                                                                                                                                   

     echo "Upload report error!\n";                                                                                                        


   $uploadfile = $uploaddir . basename($_FILES['image']['name']);                                                                                                                                                                                                                         

   if (move_uploaded_file($_FILES['image']['tmp_name'], $uploadfile)) {                                                                        

    echo "File image uploaded.\n";                                                                                                         

   } else {                                                                                                                                

    echo "Upload image error!\n";                                                                                                          


echo 'Debug info:\n';                                                                                                                     


echo "</pre>\n";                                                                                                                       




Simple Web form to send events:




<meta http-equiv="content-type" content="text/html; charset=UTF-8">


<form method="post" enctype="multipart/form-data" action="ff_post.php">

   Enter event file: <input type="file" name="event" size="40">

   Enter image file: <input type="file" name="image" size="40">

   <input type="submit" value="send" name="submit">




Sending messages with CURL executable

Provided we have following files

1470311582.json - event

etalon_hd.jpg       - image

curl --trace-ascii  headers.txt -i -X POST -F "event=@1470311582.json" -F "image=@etalon_hd.jpg"

headers.txt  - headers log

Result from data being sent to test server


curl --trace-ascii headers.txt -i -X POST -F 'event=@1470311582.json;type=application/json' -F image=@etalon_hd.jpg


HTTP/1.1 100 Continue

HTTP/1.1 200 OK

Date: Tue, 21 Feb 2017 12:23:22 GMT

Server: Apache/2.4.7 (Ubuntu)

X-Powered-By: PHP/5.5.9-1ubuntu4.17

Vary: Accept-Encoding

Content-Length: 494

Content-Type: text/html



File json uploaded.

File image uploaded.

Debug info:\nArray


[event] => Array


         [name] => 1470311582.json

         [type] => application/json

         [tmp_name] => /tmp/phpG2utRR

         [error] => 0

         [size] => 337



[image] => Array


         [name] => etalon_hd.jpg

        [type] => image/jpeg

         [tmp_name] => /tmp/phpUURZBu

         [error] => 0

         [size] => 376858





FF JSON Protocol: Exploring and Troubleshooting

Sending events as JSON documents over HTTP POST

Problem: JSON data doesn’t arrive at listening server

Reasons and Solutions:

1) The most often reason is that receiving party requires explicit instruction to allow inbound traffic of certain type and through certain ports. Network infrastructure or firewalls may also restrict traffic of certain type and may require explicit permissions. It is more to be the case when traffic is expected to cross network boundaries.

2) FF Edge ANPR applications rely on camera underlying platform layer API. Some firmwares (especially for products less than a year old) may not support required networking features (most often issues are caused by curl and ssl system libraries and API access restrictions).

Make sure you have your cameraJr firmware upgraded to the latest available version.

3) To test JSON sender try a portable local web-server, which is able to expose inbound requests. Note that it may be required to adjust firewalls (e.g. Windows Firewall) appropriately to allow inbound HTTP traffic on a machine the web-server is launched on.

There are two recommended tools  executable under Windows to choose among:

  1. portable http listener based on UsbWebServer available from . Please, download the archive and refer to the `` from the archive or online. Please, note that archive contains complete distribution including the web-server itself.

  2. Please check short how-to video on using local web-server to listen for HTTP POST requests;

4) To test a receiving party with arbitrary HTTP inquiries consider using the tool to send HTTP requests and approach as described here:

    • Related Articles

    • Monitoring Current Events

      View This mode offers live monitoring of streams from connected video sources or meta sources (LPR cameras). One place for all connected sources NumberOk supplements each detected and recognized plate with the following information: Recognised number ...
    • Feature comparison table

      Key features (comparison across editions) Lite SMB Enterprise Meta Reporter ANPR Sources IP cameras Y Y Y n/a n/a DVR Y Y Y n/a n/a Video file Y Y Y n/a n/a ANPR camera n/a n/a n/a Y n/a Results refinement analytics Y Y Y n/a n/a # of source channels ...
    • VMS integration

      General information NumberOk has been integrated with VMS . NumberOk sends to the VMS recognized license plates as Generic Events. For sending Generic Events from NumberOk are using a standard API call in the form of an HTTP string - also known as ...
    • LPR Results: Developer’s API

      Common Configuration file, log files, database reside in %ALLUSERSPROFILE%\FF\NumberOk. To enable TCP server in NumberOk set configuration parameter “NetServer.Enable” to 1 (by default 0). To enable TCP server in NumberOk3 you can use GUI interface ...
    • TCP Integration

      Preparations Set up NumberOk to recognize license plates. You will notice LP overlay accompanying vehicles under View tab when recognition is tuned up properly. TCP Integration settinga Basic settings Go to Settings > Analytic. Check Analytics: ...