Skip to content

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.

Terminal window
curl -H "X-OC-Bridge-Key: your-api-key" \
https://your-wordpress-site.com/wp-json/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": []
}
]
}
]

Returns all registered menu locations and the menu assigned to each.

Returns general WordPress site options (site name, description, URL).

Response:

{
"name": "My Blog",
"description": "Just another WordPress site",
"url": "https://blog.example.com"
}

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" }
}

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.

Returns related posts for a given post ID. Related posts are found by shared tags first, then shared categories as a fallback.

Query parameters:

ParameterDefaultDescription
count5Number of related posts to return

Response: Array of WP REST API v2 post objects.

The Magento module also calls standard WP REST v2 endpoints directly. These do not require authentication:

EndpointUsage
GET /wp/v2/postsPost 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/categoriesCategory listing
GET /wp/v2/categories/{id}Single category
GET /wp/v2/tagsTag listing
GET /wp/v2/users/{id}Author data
GET /wp/v2/media/{id}Featured image data