Problem with REST API
-
Hello,
i have the following problem:Warning: The Optimization Detective REST API endpoint is unavailable
To collect URL Metrics from visitors the REST API must be available to unauthenticated users. Specifically, visitors must be able to perform a
POSTrequest to the/optimization-detective/v1/url-metrics:storeendpoint.You may have a plugin active or server configuration which restricts access to logged-in users. Unauthenticated access must be restored in order for Optimization Detective to work.
The REST API returned with an HTTP status of
403 Forbidden.
Unerlaubte REST-Anfragen unterbinden: ist deaktiviert!i put this in the functions.php
// Erlaube nicht-authentifizierten Zugriff auf den Optimization Detective REST-API-Endpunkt
add_filter( ‘rest_authentication_errors’, function( $result ) {
$request_uri = $_SERVER[‘REQUEST_URI’] ?? ”;if ( strpos( $request_uri, '/wp-json/optimization-detective/v1/url-metrics:store' ) !== false ) { return true; // Zugriff erlauben } return $result;});
The page I need help with: [log in to see the link]
The topic ‘Problem with REST API’ is closed to new replies.