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 ?
- The topic ‘Read data with REST API ?’ is closed to new replies.