Read data with REST API ?

[ad_1]

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 ?

 

This site will teach you how to build a WordPress website for beginners. We will cover everything from installing WordPress to adding pages, posts, and images to your site. You will learn how to customize your site with themes and plugins, as well as how to market your site online.

Buy WordPress Transfer