WordPress provides support for its API through the xmlrpc.php
file located inside the root of the installation directory. Basically, we need two components to build and use an API:
Since we will use the existing API functions, we don't need to worry about the server, as it's built inside the core. So, we will build a third-party client to access the service. Later, we will improve the API server to implement custom functionalities that go beyond the existing API functions. The API client is responsible for providing the following features:
Authenticating the user with the API
Making XML-RPC requests to the server through the curl command
Defining and populating the API functions with the necessary parameters
With the preceding features in mind, let's look at the implementation of an API client:
class...