Issue Elementor Forms and nested JSON with WPGETAPI Pro
-
Hi,
I tested out the PRO version with a friend with Elementor Pro Form.The plugin works only when using JSON and separate parameters : value pairs. So for each value, an extra value pair in the settings under each other.
However with complex nested json values, it fails (nested in values).It works when the parameters is nested and has a simple value: (action:name), or when it has a “first level nested values” .
{"key1":"(action:value1)"}.The problem: when I wanted to add a SECOND level nested value, then It gave an error, and the body output was just NULL. So something like this failed always:
{"key1":{"stringValue":"(action:value1)"}}.As I chose for the body “json coding” , also in the header, the plugin then added extra faulty ” ” to the output as I could see in the logs. This gave the error, as the APGET API output JSON, did not match the JSON format required by the external system that received it. Maybe a technique to prevent the adding of extra ” ” ‘s by WPGET api could fix this in functions.php (or maybe escaping some characters).So the solution would be to enter the 1 whole nested JSON string in the BODY value field (without parameter), and with RAW CODING, the output is always BODY > NULL. Even with the simples one-elementor-form-field test, without any nested fields. So even this gives a body > null in the “action logs”:{"key1":"(action:value1)"}This adding of the whole multi-level nested JSON with all Elementor field values (action:values) would be the simplest solution but unfortunately WPGETAPI gives an error here, although this technique is recommended in your own support pages. The issue stays even when I remove the Content-Type : application/json from the Header. The issue stayed even when I disabled all other plugins, and reverted to only standard theme / elementor / wpgetapi pro.I followed all your docs, and I managed to get an Elementor form pushed with the API, but only the simple fields, not the more nested fields, that need to be pushed externally in the correct multi-layered nested JSON, required by the external API. So I know how to do the basics and do authentication with base64 etc. I also know the exact correct JSON by the server from the API response.
So there seems to be real issues with WPGETAPI PRO & Elementor Pro forms, which made me wonder if I should purchase your plugin on my own project or not, as I had this bad test with my friend here. Maybe this is too complex and I need another solutions ?Hope you can straighten this out or clarify ?
Best regards
You must be logged in to reply to this topic.