• Resolved Creastic

    (@creastic)


    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

    (@peterschulznl)

    Hi @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.