Skip to main content
1 of 3

Hide response returned from WordPress REST API call

I have made a simple REST API where user call this URL:

www.example.com/wp-json/v1/getBook/123456?AuthorSurname=Buckley

The response will returned: {"Book":"Thank you for smoking"} in browser.

I would like to hide the response / replace it with another page whenever user keys in this URL.
The response can only be shown when it is triggered by CURL post.

How can I acheive this?