REST API reference for the oc-bridge/v1 WordPress plugin endpoints
All custom endpoints live under the oc-bridge/v1 namespace and require the X-OC-Bridge-Key authentication header. Standard WordPress REST API v2 endpoints (/wp-json/wp/v2/*) are also used by the Magento module and do not require authentication.
Authentication
$ curl -H "X-OC-Bridge-Key: your-api-key" \ $ https://your-wordpress-site.com/wp-json/oc-bridge/v1/menus
Custom endpoints
GET /oc-bridge/v1/menus
Returns all registered WordPress navigation menus with their full item trees.
Response:
[
{
"id": 1,
"name": "Primary Navigation",
"slug": "primary",
"items": [
{
"id": 10,
"title": "Blog",
"url": "https://blog.example.com/",
"parent": 0,
"children": []
}
]
}
] GET /oc-bridge/v1/menu-locations
Returns all registered menu locations and the menu assigned to each.
GET /oc-bridge/v1/options
Returns general WordPress site options (site name, description, URL).
Response:
{
"name": "My Blog",
"description": "Just another WordPress site",
"url": "https://blog.example.com"
} GET /oc-bridge/v1/seo/{post_id}
Returns SEO metadata for a specific post. Pulls from Yoast SEO or RankMath if active, otherwise falls back to core WordPress data.
Response:
{
"title": "My Post Title - My Blog",
"description": "The post meta description",
"robots": "index, follow",
"og_title": "My Post Title",
"og_description": "The post meta description",
"og_image": "https://blog.example.com/wp-content/uploads/image.jpg",
"twitter_card": "summary_large_image",
"schema": { "@type": "Article", "headline": "My Post Title" }
} GET /oc-bridge/v1/sidebar-widgets
Returns all registered sidebar widget areas and their widget data.
GET /oc-bridge/v1/sidebar-widgets/{sidebar_id}
Returns widgets for a specific sidebar.
GET /oc-bridge/v1/related/{post_id}
Returns related posts for a given post ID. Related posts are found by shared tags first, then shared categories as a fallback.
Query parameters:
| Parameter | Default | Description |
|---|---|---|
count | 5 | Number of related posts to return |
Response: Array of WP REST API v2 post objects.
Standard WordPress endpoints used
The Magento module also calls standard WP REST v2 endpoints directly. These do not require authentication:
| Endpoint | Usage |
|---|---|
GET / | Post listing with pagination |
GET / | Single post by ID |
GET / | Single post by slug |
GET / | Category listing |
GET / | Single category |
GET / | Tag listing |
GET / | Author data |
GET / | Featured image data |