Meta

Once you have created a new application password, it's time to send a request to test it. Unlike the WordPress REST API, XML-RPC does not require your username and password to be base64 encoded. To begin the process, open a terminal window and enter the following:↵<code>shell↵
curl -H 'Content-Type: text/xml' -d '&lt;methodCall&gt;&lt;methodName&gt;wp.getUsers&lt;/methodName&gt;&lt;params&gt;&lt;param&gt;&lt;value&gt;1&lt;/value&gt;&lt;/param&gt;&lt;param&gt;&lt;value&gt;USERNAME&lt;/value&gt;&lt;/param&gt;&lt;param&gt;&lt;value&gt;PASSWORD&lt;/value&gt;&lt;/param&gt;&lt;/params&gt;&lt;/methodCall&gt;' LOCALHOST</code>↵
In the above example, replace <em>USERNAME</em> with your username, and <em>PASSWORD</em> with your new application password. This should output a response containing all users on your site.

Once you have created a new application password, it's time to send a request to test it. Unlike the WordPress REST API, XML-RPC does not require your username and password to be base64 encoded. To begin the process, open a terminal window and enter the following:↵<code>shell↵
curl -H 'Content-Type: text/xml' -d '&lt;methodCall&gt;&lt;methodName&gt;wp.getUsers&lt;/methodName&gt;&lt;params&gt;&lt;param&gt;&lt;value&gt;1&lt;/value&gt;&lt;/param&gt;&lt;param&gt;&lt;value&gt;USERNAME&lt;/value&gt;&lt;/param&gt;&lt;param&gt;&lt;value&gt;PASSWORD&lt;/value&gt;&lt;/param&gt;&lt;/params&gt;&lt;/methodCall&gt;' LOCALHOST</code>↵
In the above example, replace <em>USERNAME</em> with your username, and <em>PASSWORD</em> with your new application password. This should output a response containing all users on your site.

Meta

Once your username and password are base64 encoded, you are now able to make a simple REST API call using the terminal window to update a post. Because you are performing a POST request, you will need to authorize the request using your newly created base64 encoded access token. If authorized correctly, you will see the post title update to "New Title."↵<code>shell↵
curl --header "Authorization: Basic ACCESS_TOKEN" -X POST -d "title=New Title" http://LOCALHOST/wp-json/wp/v2/posts/POST_ID}</code>↵
When running this command, be sure to replace <em>ACCESS_TOKEN</em> with your newly generated access token, <em>LOCALHOST</em> with the location of your local WordPress installation, and <em>POST_ID</em> with the ID of the post that you want to edit.

Once your username and password are base64 encoded, you are now able to make a simple REST API call using the terminal window to update a post. Because you are performing a POST request, you will need to authorize the request using your newly created base64 encoded access token. If authorized correctly, you will see the post title update to "New Title."↵<code>shell↵
curl --header "Authorization: Basic ACCESS_TOKEN" -X POST -d "title=New Title" http://LOCALHOST/wp-json/wp/v2/posts/POST_ID}</code>↵
When running this command, be sure to replace <em>ACCESS_TOKEN</em> with your newly generated access token, <em>LOCALHOST</em> with the location of your local WordPress installation, and <em>POST_ID</em> with the ID of the post that you want to edit.

Meta

Now that you have your new password, you will need to base64 encode it using a terminal window as well as your username to use it with the REST API.↵
The command you will use is as follows:↵<code>shell↵
echo -n "USERNAME:PASSWORD" | base64</code>↵
Within this, you will replace <em>USERNAME:PASSWORD</em> with your username and newly generated application password. For example:↵<code>shell↵
echo -n "admin:mypassword123" | base64</code>

Now that you have your new password, you will need to base64 encode it using a terminal window as well as your username to use it with the REST API.↵
The command you will use is as follows:↵<code>shell↵
echo -n "USERNAME:PASSWORD" | base64</code>↵
Within this, you will replace <em>USERNAME:PASSWORD</em> with your username and newly generated application password. For example:↵<code>shell↵
echo -n "admin:mypassword123" | base64</code>

Meta

Once the <em>Add New</em> button is clicked, your new application password will appear. Be sure to keep this somewhere safe, as it will not be displayed to you again. If you lose this password, it cannot be obtained again.

Once the <em>Add New</em> button is clicked, your new application password will appear. Be sure to keep this somewhere safe, as it will not be displayed to you again. If you lose this password, it cannot be obtained again.