AnsweredAssumed Answered

DataAPI - Receive JSON without fieldData

Question asked by jahnix on Jan 21, 2019
Latest reply on Jan 21, 2019 by jahnix

Hi All,

I am trying to integrate with OpenALPR (Licence Plate Recognition Software) and have the JSON results posted to a Filemaker Endpoint. I have been using RestFM with xml/xslt for majority of business scenarios and thanks to Bev, have become reasonably familiar with XSLT transformations and nested records where I now even have xml driven web pages from RestFM's dataset (nice and fast).

 

My current Situation is this

OpenALPR is set to POST to a Filemaker Server Endpoint Onsite (Either via RestFM or DataAPI)

It is JSON native.

RestFM and the Filemaker DataAPI don't take the data unless fieldData/portalData or data is used to Tag - i.e. it appears that the JSON needs to be specifically formatted as it won't find fields directly (understandable why).

 

I am struggling to see if this is even achievable and if I am missing something dumb as per usual > Perusing some other responses from the usual suspects (wim) I'd need to set up something in between to receive the POST and then transform to JSON as both RestFM and DataAPI want the pre-defined tags... Is this it or is there something simpler I am missing here??!?!?!?!?

 

 

Sample JSON Code being posted looks like this - The BOLD is pretty much the only bit I want to harvest.

{

"version": 2,

"data_type": "alpr_results",

"epoch_time": 1490574589596,

"img_width": 1280,

"img_height": 720,

"processing_time_ms": 259.132385,

"error": false,

"regions_of_interest": [

{

"x": 60,

"y": 600,

"width": 620,

"height": 120

},

{

"x": 0,

"y": 0,

"width": 1280,

"height": 570

}

],

"results": [

{

"plate": "AE1T3E",

"confidence": 93.904076,

"matches_template": 1,

"plate_index": 0,

"region": "mo",

"region_confidence": 34,

"processing_time_ms": 17.029213,

"requested_topn": 10,

"coordinates": [

{

"x": 110,

"y": 300

},

{

"x": 227,

"y": 295

},

{

"x": 227,

"y": 348

},

{

"x": 113,

"y": 352

}

],

"vehicle_region": {

"x": 0,

"y": 34,

"width": 433,

"height": 433

},

"candidates": [

{

"plate": "AE1T3E",

"confidence": 93.904076,

"matches_template": 1

},

{

"plate": "AET3E",

"confidence": 83.211739,

"matches_template": 0

},

{

"plate": "A1T3E",

"confidence": 79.840271,

"matches_template": 0

},

{

"plate": "AE1T3F",

"confidence": 79.130386,

"matches_template": 1

},

{

"plate": "AEIT3E",

"confidence": 78.878433,

"matches_template": 0

},

{

"plate": "4E1T3E",

"confidence": 78.217575,

"matches_template": 0

}

]

}

],

"uuid": "unspecified-cam16488027-1490574589596",

"camera_id": 16488027,

"agent_uid": "YYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYY",

"agent_version": "2.3.111",

"agent_type": "alprd",

"site_id": "unspecified",

"company_id": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"

}

 

Response when using the DataAPI

 

Tables in dummy database:

Details > results

Details is the primary > results is nested via relationship.

 

Thanks All For Any Help Here!!!! I think the end result is going to be a mid-point transformation tool, but that's not really where I want to be to get this working!!!!

 

Yell Out if any further info needs to be provided!

Cheers!

Outcomes