• Resolved sdio8

    (@sdiong8)


    Hi, my site require user authentication (login) before the customers can browse and purchase products. I installed the plugin (version 3.35.3) (running on WP 4.8.6) and when submitting a review, I got the following error:

    500 – Internal Server Error
    Error: Request failed with status code 401

    On the ‘Diagnostics’ page, it says:

    “WP REST API: The plugin will not be able to receive reviews because REST API is disabled.” (however it’s enabled in WooCommerce).

    When tested with “myexamplesite.com/?rest_route=/wp/json”, it gives

    {“code”:”rest_unauthorized”,”message”:”Only authenticated users can access the REST API.”,”data”:{“status”:401}}.

    It seems I need to authenticate a ‘cusrev.com’ user for the review to get updated into my site via REST API. How do I do this?

Viewing 4 replies - 1 through 4 (of 4 total)
  • Plugin Author CusRev

    (@ivole)

    Thanks for trying our plugin!

    Customer reviews submitted via aggregated review forms need to be transmitted to your site and posted on product pages. If your site is locked from the internet with a password, the review form cannot connect to it and you receive an error.

    You need to enable access to WP REST API endpoint of our plugin (‘/ivole/v1/review’) to be able to use aggregated review forms on your site.

    I hope it helps.

    Thread Starter sdio8

    (@sdiong8)

    Thanks Ivole,

    I just remember I’ve intentionally blocked all unauthenticated REST API access (for security & peace of mind obviously).

    It seems a plugin could first authenticate itself, thus enabling it to access back to the server via REST API etc. Check out: https://github.com/WordPress/WordPress/blob/587da39a9e0eaea37e5f45323be0ede19d72f974/wp-includes/rest-api.php#L733-L791

    Can this be included in your plugin?

    Plugin Author CusRev

    (@ivole)

    Can you please provide more details about your proposal? I’m not sure I fully understood it.

    Plugin Author CusRev

    (@ivole)

    I haven’t heard from you for more than two months. For this reason, I’ll assume that either you are not interested in this question/problem anymore or it has been resolved. If this is not the case, please let me know and I’ll be happy to help.

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

The topic ‘Only authenticated users can access the REST API’ is closed to new replies.