Contents
On this page

Get Rendered FAQ Page - Plugixa FAQ

GET /plugixa-faq/v1/faqs/page

Render one page of FAQs as ready-to-insert HTML. This is the call the front end makes when a visitor pages through a FAQ list.

Public: no authentication. Only FAQs that are published and have public visibility are rendered, and no private column ever leaves the server.

Note. enable_permalinks, permalink_text, permalink_position and enable_social_share always override the view, because they have defaults: a call that leaves them out turns permalinks and sharing off even when the view turns them on. Send the values you want.

Request

GET https://your-site.example/wp-json/plugixa-faq/v1/faqs/page?instance_id=faq-1&category=shipping&per_page=5&page=2

Query parameters

Name Type Default Description
instance_id string Required. Any id for the FAQ block on your page.
view string Slug of a view whose layout, icon, behaviour and pagination colours to use. Unknown slugs are ignored.
category string Comma-separated category slugs.
ids string Comma-separated ids.
limit integer -1 Cap on items before paging. -1 for no cap.
orderby string menu_order id, question, menu_order, created_at or view_count.
order string ASC ASC or DESC, in capitals.
per_page integer 10 Top-level items per page, 1 to 100.
page integer 1 Page to render. A page past the end renders the last page.
style string numbers numbers, load_more or infinite_scroll (no pagination HTML).
load_more_label string Load More Button text for load_more.
content_source string plugixa_faqs plugixa_faqs, wordpress_posts, wordpress_pages or wordpress_media. Pro adds woocommerce_products. See Content sources.
content_display string excerpt full or excerpt, for posts and pages.
enable_permalinks boolean false Show a link to each answer.
permalink_text string Permalink Text of that link.
permalink_position string answer-top-right Where the link sits.
enable_social_share boolean false Show share buttons.

Nested FAQs stay with their parent: paging counts top-level FAQs only. With WPML or Polylang active, FAQs in the current language are served, falling back to the default language. See Pagination.

Responses

200 OK. data holds the HTML fragments.

{
  "success": true,
  "message": "",
  "data": {
    "items_html": "<details open>...</details>",
    "pagination_html": "<nav aria-label=\"FAQ pagination\">...</nav>",
    "current_page": 2,
    "total_pages": 3.0,
    "total_faqs": 12
  }
}
Field Type Meaning
data.items_html string The FAQ items, rendered with the layout of the view or the site settings
data.pagination_html string Page links or the “load more” button, empty when not needed
data.current_page integer The page rendered
data.total_pages number Pages at this per_page, sent as a decimal such as 3.0
data.total_faqs integer Top-level items before paging

With nothing to show, items_html is a “No FAQs found.” paragraph, current_page is 1, total_pages is 0, and total_faqs is absent.

Errors

Status Code When
400 rest_missing_callback_param instance_id is missing.
400 rest_invalid_param order, style, content_source or content_display is not a listed value, or per_page is outside 1 to 100.

Plus the errors every endpoint can return.

Examples

curl -s "https://your-site.example/wp-json/plugixa-faq/v1/faqs/page?instance_id=faq-1&category=shipping&per_page=5&page=2"
<?php
$query = http_build_query([
    'instance_id' => 'faq-1',
    'category'    => 'shipping',
    'per_page'    => '5',
    'page'        => '2',
]);
$ch = curl_init('https://your-site.example/wp-json/plugixa-faq/v1/faqs/page?' . $query);
curl_setopt_array($ch, [
    CURLOPT_RETURNTRANSFER => true,
]);
$response = json_decode(curl_exec($ch), true);
curl_close($ch);
const query = new URLSearchParams({ instance_id: 'faq-1', category: 'shipping', per_page: '5', page: '2' });
const response = await fetch(`https://your-site.example/wp-json/plugixa-faq/v1/faqs/page?${query}`);
const { data } = await response.json();

Quick Links

Share