REST 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
Section titled “Authentication”curl -H "X-OC-Bridge-Key: your-api-key" \ https://your-wordpress-site.com/wp-json/oc-bridge/v1/menusCustom Endpoints
Section titled “Custom Endpoints”GET /oc-bridge/v1/menus
Section titled “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
Section titled “GET /oc-bridge/v1/menu-locations”Returns all registered menu locations and the menu assigned to each.
GET /oc-bridge/v1/options
Section titled “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}
Section titled “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
Section titled “GET /oc-bridge/v1/sidebar-widgets”Returns all registered sidebar widget areas and their widget data.
GET /oc-bridge/v1/sidebar-widgets/{sidebar_id}
Section titled “GET /oc-bridge/v1/sidebar-widgets/{sidebar_id}”Returns widgets for a specific sidebar.
GET /oc-bridge/v1/related/{post_id}
Section titled “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
Section titled “Standard WordPress Endpoints Used”The Magento module also calls standard WP REST v2 endpoints directly. These do not require authentication:
| Endpoint | Usage |
|---|---|
GET /wp/v2/posts | Post listing with pagination |
GET /wp/v2/posts/{id} | Single post by ID |
GET /wp/v2/posts?slug={slug} | Single post by slug |
GET /wp/v2/categories | Category listing |
GET /wp/v2/categories/{id} | Single category |
GET /wp/v2/tags | Tag listing |
GET /wp/v2/users/{id} | Author data |
GET /wp/v2/media/{id} | Featured image data |