Title: Read data with REST API ?
Last modified: September 26, 2023

---

# Read data with REST API ?

 *  Resolved [Creastic](https://wordpress.org/support/users/creastic/)
 * (@creastic)
 * [2 years, 8 months ago](https://wordpress.org/support/topic/read-data-with-rest-api/)
 * Hello,
 * I try to use REST API to generate json from a table.
 * I don’t see documentation about that.
 * I use WPDA SAS exemple and Premium WPDA plugin for this test :
 * 1/ In explorer, I select wpda_sas_student Table
 * 2/ In Setting of wpda_sas_student, I select REST API and check Enable REST API
   for table wpda_sas_student And I select roles to grant acces to “Adiministator”
 * 3/ Now, while I’m connected in administrator, I test the link :
 * h-t-tp://sitename.com/wp-json/wpda/table/lov?dbs=mydbname&tbl=wpda_sas_student&
   col=1
 * It return :
 * {“code”:”error”,”message”:”Unauthorized”,”data”:{“status”:401}}
 * Error “Unauthorized 401” too if I use this script in Code Editor with something
   like :
 * $path = ‘ht-tp-s://mysite.com/wp-json/wpda/table/lov?dbs=namedb&tbl=wpda_sas_student&
   col=1’;
   $jsonString = file_get_contents($path);
 * Can you help me on these points ?

Viewing 1 replies (of 1 total)

 *  Plugin Author [Passionate Programmer Peter](https://wordpress.org/support/users/peterschulznl/)
 * (@peterschulznl)
 * [2 years, 8 months ago](https://wordpress.org/support/topic/read-data-with-rest-api/#post-17079802)
 * Hi [@creastic](https://wordpress.org/support/users/creastic/)
 * Thank you for reaching out! And how great to see you already found the REST API.
   😇
 * We are currently developing a new version with a strict separation of client 
   and server code. Although the REST API is already included in the current version
   for testing purposes, I would strongly advice not to use it in production yet.
   It might be subject to chance before we roll out the new version. Please be patient…
 * If you want to use the REST API for testing purposes or preparation, just open
   the settings (Data Explorer > Settings > REST API > Select) and enable anonymous
   access. This allows anonymous users to query your data while other DML actions
   require a WordPress role (like administrator).
 * Hope this helps,
   Peter

Viewing 1 replies (of 1 total)

The topic ‘Read data with REST API ?’ is closed to new replies.

 * ![](https://ps.w.org/wp-data-access/assets/icon-256x256.png?rev=3299063)
 * [WP Data Access – App Builder for Tables, Forms, Charts, Maps & Dashboards](https://wordpress.org/plugins/wp-data-access/)
 * [Support Threads](https://wordpress.org/support/plugin/wp-data-access/)
 * [Active Topics](https://wordpress.org/support/plugin/wp-data-access/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/wp-data-access/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/wp-data-access/reviews/)

 * 1 reply
 * 2 participants
 * Last reply from: [Passionate Programmer Peter](https://wordpress.org/support/users/peterschulznl/)
 * Last activity: [2 years, 8 months ago](https://wordpress.org/support/topic/read-data-with-rest-api/#post-17079802)
 * Status: resolved