There’s an issue in your code: The HTTP method is not valid because WP_REST_Server::READABLE
is a class constant, hence it should not be wrapped in quotes:
register_rest_route( 'adventapi/v1', '/adventapi/', array(
// 'methods' => 'WP_REST_Server::READABLE', // wrong
// 'methods' => "WP_REST_Server::READABLE", // wrong
'methods' => WP_REST_Server::READABLE, // correct
// ... other args.
) );
You should also ensure that you use the correct request/HTTP method as well as correct endpoint URL, e.g. https://example.com/wp-json/adventapi/v1/adventapi
, when making requests to the API.