Title: Nested JSON has a query parameters bug
Last modified: November 27, 2022

---

# Nested JSON has a query parameters bug

 *  Resolved [vedante30](https://wordpress.org/support/users/vedante30/)
 * (@vedante30)
 * [3 years, 6 months ago](https://wordpress.org/support/topic/nested-json-has-a-query-parameters-bug/)
 * First of all I want to say that this is a gret plugin!
    Thank you for creating
   it! I have found a small bug on the full version of the plugin. I have tried 
   the free version and the “nested JSON” option was working perfectly, When i started
   to use the full version, “nested JSON” stop accepting **query parameters** in“
   Input JSON URL” field. I get “Error! Unable to retrieve results” when I click“
   Get JSON roots” or “Conflict Error” when I click Save changes. Example of JSON
   URL: `https://data.gov.il/api/3/action/datastore_search?resource_id=2de7b543-
   e13d-4e7e-b4c8-56071bc4d3c8&limit=1000` [https://prnt.sc/ToYMoCA_Ph69](https://prnt.sc/ToYMoCA_Ph69)
   [https://prnt.sc/aUE1qjc8FS8g](https://prnt.sc/aUE1qjc8FS8g) **When I delete 
   the query parameter (&limit=1000) from the URL, it works fine.** What i already
   tried: 1) Different JSON API urls 2) Different Server / localhost 2) Disabling
   other plugins Please check why the query parameters are not accepted on the full
   version. Thanks in advance!
    -  This topic was modified 3 years, 6 months ago by [vedante30](https://wordpress.org/support/users/vedante30/).

Viewing 3 replies - 1 through 3 (of 3 total)

 *  Plugin Author [wpDataTables](https://wordpress.org/support/users/wpdatatables/)
 * (@wpdatatables)
 * [3 years, 6 months ago](https://wordpress.org/support/topic/nested-json-has-a-query-parameters-bug/#post-16240473)
 * Hello, [@vedante30](https://wordpress.org/support/users/vedante30/)
    Since you’re
   using the Premium version of the plugin, please open a ticket in the “Pre-Purchase”
   section on our [official support platform](https://tmsplugins.ticksy.com/), and
   we’ll gladly help you there.
 * Premium products are [not supported in these forums](https://wordpress.org/support/guidelines/#do-not-post-about-commercial-products),
   as per [this comment](https://wordpress.org/support/topic/error-when-not-logged-into-wordpress-backend/#post-15050671)
   by WordPress.org moderators.
 * Thank you for understanding.
 *  Thread Starter [vedante30](https://wordpress.org/support/users/vedante30/)
 * (@vedante30)
 * [3 years, 6 months ago](https://wordpress.org/support/topic/nested-json-has-a-query-parameters-bug/#post-16243232)
 * I have found a ready to use solution for that issue (Till the PRO plugin will
   be fixed).
    Putting it here if anybody with same issue will need it.
 * Add this code in your functions.php theme file:
 *     ```
       add_action( 'parse_request', 'simplify_nested_json', 0 );
       function simplify_nested_json( $wp ) {
           // Check if the request is /simplify-json
           if ( 'simplify-json' !== $wp->request ) {
               return;
           }
       $url ='https://data.gov.il/api/3/action/datastore_search?resource_id=2de7b543-e13d-4e7e-b4c8-56071bc4d3c8&limit=3000';
       $JSON = file_get_contents($url);
       // echo the JSON (you can echo this to JavaScript to use it there)
       // You can decode it to process it in PHP
       $data = json_decode($JSON);
           // Array version of the JSON data.
           // Send headers.
           status_header( 200 );
           nocache_headers();
           header( 'Content-Type: application/pkcs7-mime' );
           // And serve the JSON data.
            echo wp_json_encode($data->result->records );
           exit;
       }
       ```
   
 * This code turns the nested JSON to a flat one.
    * Change the **$url** with your
   required API URL. * Change this part `$data->result->records` with the rout to
   the requested part of the JSON * Add [https://yoursite.com/simplify-json](https://yoursite.com/simplify-json)“
   Input JSON URL” field.
    -  This reply was modified 3 years, 6 months ago by [vedante30](https://wordpress.org/support/users/vedante30/).
    -  This reply was modified 3 years, 6 months ago by [vedante30](https://wordpress.org/support/users/vedante30/).
 *  Plugin Author [wpDataTables](https://wordpress.org/support/users/wpdatatables/)
 * (@wpdatatables)
 * [3 years, 6 months ago](https://wordpress.org/support/topic/nested-json-has-a-query-parameters-bug/#post-16244020)
 * Hi, vedante30
    Thank you for sharing your solution on the Forum for other users.
   We are aware of this, and our developers will fix this issue for the premium 
   version in the next update. The Lite version does not have this issue. Thanks
   again for sharing your workaround with us.

Viewing 3 replies - 1 through 3 (of 3 total)

The topic ‘Nested JSON has a query parameters bug’ is closed to new replies.

 * ![](https://ps.w.org/wpdatatables/assets/icon-128x128.gif?rev=3010404)
 * [wpDataTables - WordPress Data Table, Dynamic Tables & Table Charts Plugin](https://wordpress.org/plugins/wpdatatables/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/wpdatatables/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/wpdatatables/)
 * [Active Topics](https://wordpress.org/support/plugin/wpdatatables/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/wpdatatables/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/wpdatatables/reviews/)

## Tags

 * [json](https://wordpress.org/support/topic-tag/json/)

 * 5 replies
 * 2 participants
 * Last reply from: [wpDataTables](https://wordpress.org/support/users/wpdatatables/)
 * Last activity: [3 years, 6 months ago](https://wordpress.org/support/topic/nested-json-has-a-query-parameters-bug/#post-16244020)
 * Status: resolved