Step 1: Setup local WordPress

WordPress needs an RDBMS to store blog posts and comments. Here is one way to set up the database:

Create local DB (OSX instruction using Homebrew)

  1. Download and install Homebrew .
  2. brew install mysql
  3. mysql.server start May need to restart the machine if mysql.server start doesn’t work.
  4. mysql -u root -p with no password (Press enter at the password prompt). This will open the mysql command prompt.
  5. Run the following SQL in the mysql command prompt:
    1. CREATE USER 'wordpress'@'%' IDENTIFIED BY 'wordpress';
    2. CREATE DATABASE wordpress;
    3. GRANT ALL ON wordpress.* TO 'wordpress'@'%';
  6. To verify the wordpress user, run mysql -u wordpress -p in the terminal with password wordpress . The terminal should show a mysql prompt. Entering SHOW DATABASES; at the mysql prompt should show the wordpress database.

Now you can run WordPress by installing locally.

Run WordPress locally

  1. Make sure that the mysql server is running at localhost:3306 (if not, run mysql.server start ).
  2. Change directories to the sample integration service source directory.
  3. php -f scripts/test_database_connection.php
  4. If the command prints Connected successfully , php and mysql are working.
  5. Common causes for failure include:
    • MySQL is not running on the correct host and port.
    • Your php version doesn't contain the correct MySQLi library.
    • On Mac OS X, you can install php (WordPress recommends 5.6 as of 15th July 2016) through [ ].
  6. Get the latest WordPress source code from and unzip it.
  7. Change directories to the unzipped WordPress directory (where wp-login.php is located).
  8. Run php -S to start the WordPress server (the port number can be replaced by any unbound port on the machine).
  9. Go to in a browser. WordPress will guide you through the setup.

You need to install two WordPress plugins - rest-api for responding to API requests and JSON Basic Authentication for authentication.

Install the "rest-api" WordPress plugin

  1. Open your local WordPress in a browser.
  2. Log in as admin/123456 or the username and password set up during WordPress config.
  3. Navigate to Plugins/Add New.
  4. Search for WordPress REST API (Version 2) .
  5. Install the WP REST API plugin.
  6. Activate the WP REST API plugin.
  7. Verify the plugin is working by running curl http://<Url and port of the WordPress Instance>/wp-json/wp/v2/posts (for example, curl ). That should return a json that contains all the posts.
    • If curling the endpoint returns html instead of json, in WordPress, go to Admin > Settings > Permalink and change the setting to Post Link. That should fixes the issue. See Original Issue .

Install the "JSON Basic Authentication" plugin

  1. Navigate to [ ].
  2. Click "Clone or download".
  3. Click Download zip and save file locally.
  4. In WordPress, navigate to Plugins/Add New.
  5. Click Upload Plugin.
  6. Choose the file you downloaded previously.
  7. Install the JSON Basic Authentication plugin.
  8. Activate the JSON Basic Authentication plugin.
  9. Verify the plugin is working by running curl -v --user <username>:<password> http://<Url and port of the WordPress Instance>/wp-json/wp/v2/users . (for example curl -v --user admin:123456 ). You should get the list of WordPress users, and the http headers should include Server auth using Basic with user <username> . Add AppendixWordPressAuthScreenshot.png here WordPress is set up correctly now. Create some blog posts and comments on those posts using the WordPress UI - the comments will show up in Zendesk Support once you finish the tutorial.

Step 2: Setup Integration Service Environment

The tutorial integration service is written in Node using the Express framework. You can use any language or framework to build your own integration services. Zendesk recommends using OAuth and SSL with the external service whenever possible. Zendesk Support requires SSL when communicating with the integration service.

Setting up the Node/Express server

  1. Go to the sample integration service source code directory .
  2. Download node from [ ] and install it.
  3. nodenv local 5.7.0
  4. npm install Now your environment is set up for the tutorial.