Our first check is to see whether the API is enabled on the server or not, and for this we will be making use of a simple GET request that will be sent to the /wp-json/
endpoint, which will then analyze the status of the response that has been received. A next step is to launch an HTTP client and send another request to the /wp-json/
endpoint, which would be something like this:
GET http://example-site/wp-json/
and will return a JSON response.
We have our focus upon on the oauth1
value that further sends us the authentication
property value, and has within its properties the following: request, access, version and authorize.
Server responses will usually contain an empty authorization
property if the OAuth API is not enabled for the site, and the oauth1
defined object within the authentication
property will show that the OAuth API has successfully passed.