Integrating Symphona with WordPress
Symphona provides easy integration with any WordPress website. In this tutorial, we’ll go over how to integrate:
- Flow processes with WordPress
- Converse agents widgets with WordPress
Both are done by calling your WordPress website’s API. If you’re unfamiliar with APIs, don’t worry. This tutorial will give you the basics you need to integrate Symphona with any tool.
So let’s dive in!
API 101
In order to integrate Symphona with WordPress (or any software), you’ll need to invoke / call its API.
Imagine you’re a customer at a restaurant. An API is like a waiter.
- It provides you a menu of what you can request.
- It communicates your request to the kitchen (back-end).
- It returns with a response from the kitchen, which could be what you requested, a prompt for more information, or an error.
Similarly, when you’re in Symphona, you can call WordPress’s API and make requests to a specific WordPress website by providing the URL (the website address at the top of your browser) that has the particular information you’re looking for.
There are four main standardized HTTP methods (or API request methods) that you can make to any API:
Request method | Description | Uses in WordPress | Potential Symphona Workflows |
GET | Retrieves a resource | Get data of all of your WordPress Posts | Collects all your WordPress posts and feeds its contents into an LLM |
POST | Creates a new resource | Generate a new WordPress Post | Generate and post a series of WordPress posts |
PUT | Edits or updates an existing resource | Edits an existing WordPress Post | Edit WordPress posts whose contents have mispellings |
DELETE | Deletes a resource | Deletes a Post | Delete WordPress posts that contain certain words |
That’s all you need to know to start integrating Symphona with any tool. If you want a more technical breakdown of APIs, you can read our guide here. For more details on how WordPress’s API works, you can read their official documentation here.
Now let’s integrate a process and a chatbot with WordPress!
Integrating a Flow Process with WordPress
Step 1: In Flow’s process editor, go to the Step Library on the right and click on Integration. Under Integration, click and move “Invoke REST API (General)” and move it into the workflow wherever you want the process to invoke WordPress’s API.
Step 2: Click on the Invoke REST API (General) step within your workflow to access its settings. You’ll see its Rest Configuration and Output Configuration modules. This is where we’ll call the WordPress API.
Step 3: Paste your WordPress URL in the API URL box.
Two notes here:
- The URL you post will depend upon what information you’re trying to access and/or where you want to move information to.
- For example, if you want to collect all your posts to feed them into an LLM, you would want to paste the URL to your WordPress posts webpage.
- You need to post the REST API version of your URL. To do this, simply take your URL and add the following string to the end of your site's url: /wp-json/wp/v2 (e.g. http://oursite.com/ becomes http://oursite.com/wp-json/wp/v2).
- If you wanted to access all your posts, you would append
wp-json/wp/v2/posts
to your website. - WordPress’s REST API Handbook offers more resources if you need more support.
Step 6: Select which API Request Method you want from the dropdown menu. This will tell Symphona what you want to do when you call the API. The option you select will depend on what you want to accomplish with the workflow.
Step 7: Choose what type of data you want to request in the Body Type section.
Step 8: If your website requires authentication, you can pass on your username and password by creating two separate parameters for each in the API Request Header Parameters section.
Step 9: set up an output parameter if you’re extracting information. You can name the parameter and specify what info you want.
- If you’re pulling a JSON object, simply typing $ in the API Field Name will obtain the full object. You can use dot notation to access subfields. We’ll cover this in a future tutorial.
Step 9: Press Deploy to save your changes. Go to Process Trigger to execute your process. You can check the status of the execution by clicking View Execution once the process runs.
Integrating a Converse Agent Widget into WordPress
The steps for integrating WordPress with a Converse agent widget are largely the same as doing so with a Flow process.
Structured Agents
Structured agents can’t invoke APIs on their own, but they can execute Flow processes that do.
To integrate WordPress with a structured agent:
- Set up a process in Flow that handles the integration.
- Open the Agent Editor in Converse and create a new agent. Drag-and-drop the Action step into the editor.
- Select it and pick Execute Process (synchronously or asynchronously is up to you), and then under the Parameters section, choose the process.
Generative Agents
For generative agents, click Select Action in the Objectives section and choose Invoke API. You’ll see most of the same fields that the Invoke Step has in Flow. You can then add the request URL, the request method, and any authentication parameters in the header section.