CP.AI API Response JSON Parsing | BI Alerts

Post Reply
scottishbeatts
Posts: 2
Joined: Thu Jul 25, 2024 11:42 am

CP.AI API Response JSON Parsing | BI Alerts

Post by scottishbeatts »

I want to send BI alerts for facial recognition (person identified) into our automation and orchestration platform. The issue is that the alerts GUI seems to only allow creation of alerts using a binary of whether or not the API call was success or not - success meaning the recognise function of the API has matched the face within the accuracy limits, this is fine however i would like to perform conditionaly based automations based on the data in the API repsonse body. The CP.AI API"s response body has many other keys and values that i would like to use for both automating entry to a gate that is no longer manned and tracking entry at a clients secure site. So i would like a way within the alerts definition to include the values of "User_ID" and "Confidence" and send those as part of the alert. The Testing & Tuning functions of video review shows this data in the overlay, so does anyone know if there is a way to reference this?? I've tried lots of different options, and im using the "Write to File - Append" alert type as a way of quickly tetsing but havent had any luck so far, i guess its how does BI parse the response and are those variables accessible from the gui?

NB: some said to me eariler that you can use the user-id and the name used when registering the face on CP.AI, however this involves manually adding names to the AI object referenced by the Alert which feels like a bodge, and if i can avoid it i will as my testing of that function has not been stellar, particularly if you put spaces in the name
scottishbeatts
Posts: 2
Joined: Thu Jul 25, 2024 11:42 am

Re: CP.AI API Response JSON Parsing | BI Alerts

Post by scottishbeatts »

I figured it out - $JSON is the BI variable with the entire JSON response
User avatar
TimG
Posts: 2391
Joined: Tue Jun 18, 2019 10:45 am
Location: Nottinghamshire, UK.

Re: CP.AI API Response JSON Parsing | BI Alerts

Post by TimG »

Thank you for letting us know :D
Forum Moderator.
Problem ? Ask and we will try to assist, but please check the Help file.
Post Reply