> Portal Navigation:
> 
> - Append `.md` to any URL under `https://dev.wix.com/docs/` to get its markdown version.
> - Pages are either content pages (article or reference text) or menu pages (a list of links to child pages).
> - To get a menu page, truncate any URL to a parent path and append `.md` (e.g. `https://dev.wix.com/docs/sdk.md`, `https://dev.wix.com/docs/sdk/core-modules.md`).
> - Top-level index of all portals: https://dev.wix.com/docs/llms.txt
> - Full concatenated docs: https://dev.wix.com/docs/llms-full.txt

# ListDynamicItemPages

# Package: richContent

# Namespace: RicosSiteContext

# Method link: https://dev.wix.com/docs/api-reference/assets/rich-content/site-context-v1/list-dynamic-item-pages.md

## Permission Scopes:
Read Site Context for Rich Content: SCOPE.DC-RICOS.READ-SITE-CONTEXT

## Introduction

Lists the item pages of a dynamic page, with cursor paging.

Specify the `path` of a dynamic page that [List Dynamic Pages](https://dev.wix.com/docs/api-reference/assets/rich-content/site-context-v1/list-dynamic-pages.md) returns as `prefix`, and its `id` as `pageId`.

Item pages are read from the published version of the site. The method doesn't check that the site is published. Check the `published` field of the response.

The method doesn't validate `prefix` or `pageId`. If they don't match a dynamic page of the site, no item pages are returned and the call doesn't fail.

---

## REST API

### Schema

```
 Method: listDynamicItemPages
 Description: Lists the item pages of a dynamic page, with cursor paging.  Specify the `path` of a dynamic page that [List Dynamic Pages](https://dev.wix.com/docs/api-reference/assets/rich-content/site-context-v1/list-dynamic-pages.md) returns as `prefix`, and its `id` as `pageId`.  Item pages are read from the published version of the site. The method doesn't check that the site is published. Check the `published` field of the response.  The method doesn't validate `prefix` or `pageId`. If they don't match a dynamic page of the site, no item pages are returned and the call doesn't fail.
 URL: https://www.wixapis.com/ricos/v1/site-context/dynamic-item-pages/list
 Method: POST
 # Note: If the parameter `a.b` is listed under required parameters, `b` is only required if `a` is also present.
 Required parameters:  prefix
 Method parameters: 
   param name: pageId | type: pageId | description: `id` of the dynamic page, as [List Dynamic Pages](https://dev.wix.com/docs/api-reference/assets/rich-content/site-context-v1/list-dynamic-pages.md) returns it. It's not the `id` of an item page. Several dynamic pages can share the same `prefix`, because the page that lists the items and the template of the item pages of one collection use the same prefix. Specify `pageId` to list only the item pages of that dynamic page. If you omit it, the item pages of all dynamic pages with this `prefix` are returned. If `pageId` isn't the `id` of a dynamic page with this `prefix`, no item pages are returned.  | validation: maxLength 300
   param name: paging | type: CursorPaging | description: Cursor-based pagination parameters for listing requests.  
        - name: limit | type: integer | description: Number of items to load per page.  | validation: minimum 0, maximum 100, format int32
        - name: cursor | type: string | description: Cursor token for pagination. Use the cursor from the previous response to get the next page of results.  | validation: maxLength 16000
   param name: prefix | type: prefix | description: `path` of the dynamic page, as [List Dynamic Pages](https://dev.wix.com/docs/api-reference/assets/rich-content/site-context-v1/list-dynamic-pages.md) returns it. For example, `/items`. A value without the leading `/` is also accepted. | required: true | validation: maxLength 256
 Return type: ListDynamicItemPagesResponse
  - name: items | type: array<SitePage> | description: Item pages of the dynamic page.  
     - name: id | type: string | description: Page GUID of a static page or a dynamic page. For an item page, this is an opaque key that identifies the item page. It isn't a page GUID or a collection item GUID, so don't specify it as `pageId` in [List Dynamic Item Pages](https://dev.wix.com/docs/api-reference/assets/rich-content/site-context-v1/list-dynamic-item-pages.md), and don't parse it.  | validation: maxLength 300
     - name: title | type: string | description: Page title. For an item page, the name of the item. Empty if the item has no name.  | validation: maxLength 1000
     - name: path | type: string | description: Path of the page within the site. Store `path`, not `url`, as the link target, because it doesn't depend on the site's domain.  Always starts with `/`. For example: + Static page: includes the paths of the parent pages. For example, `/about/team`. + Dynamic page: the path shared by its item pages. For example, `/items`. + Item page: the dynamic page's path followed by the item's path. For example, `/items/first-item`.  | validation: maxLength 2000
     - name: url | type: string | description: Full URL of the page: the site's base URL followed by `path`. Use it to display or preview the link, but don't store it.  | validation: maxLength 4000
     - name: hasItemPages | type: boolean | description: Whether the dynamic page is the template of the item pages, as opposed to the page that lists the items. Returned only for dynamic pages. `false` is also returned for a dynamic page that has no item pages. If the site isn't published, item pages aren't available yet.  
  - name: published | type: boolean | description: Whether the site is published. If `false`, item pages aren't available yet, and page URLs can't be reached by visitors yet.  
  - name: pagingMetadata | type: CursorPagingMetadata | description: Paging metadata. To retrieve the next page of results, specify `cursors.next` in `paging.cursor`.  
     - name: count | type: integer | description: Number of items returned in the current response.  | validation: format int32
     - name: cursors | type: Cursors | description: Navigation cursors for moving between result pages.  
        - name: next | type: string | description: Cursor for retrieving the next page of results.  | validation: maxLength 16000
        - name: prev | type: string | description: Cursor for retrieving the previous page of results.  | validation: maxLength 16000
     - name: hasNext | type: boolean | description: Whether there are more pages to retrieve following the current page.  

 Possible Errors:
   HTTP Code: 400 | Status Code: INVALID_ARGUMENT | Application Code: SITE_CONTEXT_INVALID_CURSOR | Description: The paging cursor is invalid or expired. Start again without a cursor.


```

### Examples

### List dynamic item pages
Retrieves the item pages of a dynamic page

```curl
curl -X POST \
'https://www.wixapis.com/ricos/v1/site-context/dynamic-item-pages/list' \
-H 'Authorization: <AUTH>' \
-H 'Content-Type: application/json' \
-d '{
  "prefix": "/items",
  "paging": {
    "limit": 50
  }
}'


{
  "items": [
    {
      "id": "items/{title}_602471ba-1d5e-4177-acd3-d63655d8fdb9",
      "title": "First item",
      "path": "/items/first-item",
      "url": "https://username.wixsite.com/mysite/items/first-item"
    }
  ],
  "published": true,
  "pagingMetadata": {
    "count": 1,
    "cursors": {},
    "hasNext": false
  }
}


curl -X POST \
'https://www.wixapis.com/ricos/v1/site-context/dynamic-item-pages/list' \
-H 'Authorization: <AUTH>' \
-H 'Content-Type: application/json' \
-d '{
  "prefix": "/items",
  "pageId": "es8i1"
}'
```

---

## JavaScript SDK

### Schema

```
 Method: wixClientAdmin.richContent.ricosSiteContext.listDynamicItemPages(prefix, options)
 Description: Lists the item pages of a dynamic page, with cursor paging.  Specify the `path` of a dynamic page that [List Dynamic Pages](https://dev.wix.com/docs/api-reference/assets/rich-content/site-context-v1/list-dynamic-pages.md) returns as `prefix`, and its `id` as `pageId`.  Item pages are read from the published version of the site. The method doesn't check that the site is published. Check the `published` field of the response.  The method doesn't validate `prefix` or `pageId`. If they don't match a dynamic page of the site, no item pages are returned and the call doesn't fail.
 # Note: If the parameter `a.b` is listed under required parameters, `b` is only required if `a` is also present.
 Required parameters:  prefix
 Method parameters: 
   param name: options | type: ListDynamicItemPagesOptions  none  
        - name: pageId | type: string | description: `id` of the dynamic page, as [List Dynamic Pages](https://dev.wix.com/docs/api-reference/assets/rich-content/site-context-v1/list-dynamic-pages.md) returns it. It's not the `id` of an item page. Several dynamic pages can share the same `prefix`, because the page that lists the items and the template of the item pages of one collection use the same prefix. Specify `pageId` to list only the item pages of that dynamic page. If you omit it, the item pages of all dynamic pages with this `prefix` are returned. If `pageId` isn't the `id` of a dynamic page with this `prefix`, no item pages are returned.  | validation: maxLength 300
        - name: paging | type: CursorPaging | description: Cursor paging options.  Default: `paging.limit` is `50`.  
           - name: limit | type: integer | description: Number of items to load per page.  | validation: minimum 0, maximum 100, format int32
           - name: cursor | type: string | description: Cursor token for pagination. Use the cursor from the previous response to get the next page of results.  | validation: maxLength 16000
   param name: prefix | type: string | description: `path` of the dynamic page, as [List Dynamic Pages](https://dev.wix.com/docs/api-reference/assets/rich-content/site-context-v1/list-dynamic-pages.md) returns it. For example, `/items`. A value without the leading `/` is also accepted. | required: true | validation: maxLength 256
 Return type: PROMISE<ListDynamicItemPagesResponse>
  - name: items | type: array<SitePage> | description: Item pages of the dynamic page.  
     - name: _id | type: string | description: Page GUID of a static page or a dynamic page. For an item page, this is an opaque key that identifies the item page. It isn't a page GUID or a collection item GUID, so don't specify it as `pageId` in [List Dynamic Item Pages](https://dev.wix.com/docs/api-reference/assets/rich-content/site-context-v1/list-dynamic-item-pages.md), and don't parse it.  | validation: maxLength 300
     - name: title | type: string | description: Page title. For an item page, the name of the item. Empty if the item has no name.  | validation: maxLength 1000
     - name: path | type: string | description: Path of the page within the site. Store `path`, not `url`, as the link target, because it doesn't depend on the site's domain.  Always starts with `/`. For example: + Static page: includes the paths of the parent pages. For example, `/about/team`. + Dynamic page: the path shared by its item pages. For example, `/items`. + Item page: the dynamic page's path followed by the item's path. For example, `/items/first-item`.  | validation: maxLength 2000
     - name: url | type: string | description: Full URL of the page: the site's base URL followed by `path`. Use it to display or preview the link, but don't store it.  | validation: maxLength 4000
     - name: hasItemPages | type: boolean | description: Whether the dynamic page is the template of the item pages, as opposed to the page that lists the items. Returned only for dynamic pages. `false` is also returned for a dynamic page that has no item pages. If the site isn't published, item pages aren't available yet.  
  - name: published | type: boolean | description: Whether the site is published. If `false`, item pages aren't available yet, and page URLs can't be reached by visitors yet.  
  - name: pagingMetadata | type: CursorPagingMetadata | description: Paging metadata. To retrieve the next page of results, specify `cursors.next` in `paging.cursor`.  
     - name: count | type: integer | description: Number of items returned in the current response.  | validation: format int32
     - name: cursors | type: Cursors | description: Navigation cursors for moving between result pages.  
        - name: next | type: string | description: Cursor for retrieving the next page of results.  | validation: maxLength 16000
        - name: prev | type: string | description: Cursor for retrieving the previous page of results.  | validation: maxLength 16000
     - name: hasNext | type: boolean | description: Whether there are more pages to retrieve following the current page.  

 Possible Errors:
   HTTP Code: 400 | Status Code: INVALID_ARGUMENT | Application Code: SITE_CONTEXT_INVALID_CURSOR | Description: The paging cursor is invalid or expired. Start again without a cursor.


```

### Examples

### List dynamic item pages
Retrieves the item pages of a dynamic page.

```javascript
import { ricosSiteContext } from "@wix/rich-content";

async function listDynamicItemPages() {
  const response = await ricosSiteContext.listDynamicItemPages("/items", {
    pageId: "es8i1",
    paging: {
      limit: 50,
    },
  });
}

/* Promise resolves to:
 * {
 *   "items": [
 *     {
 *       "_id": "items/{title}_602471ba-1d5e-4177-acd3-d63655d8fdb9",
 *       "title": "First item",
 *       "path": "/items/first-item",
 *       "url": "https://username.wixsite.com/mysite/items/first-item"
 *     }
 *   ],
 *   "published": true,
 *   "pagingMetadata": {
 *     "count": 1,
 *     "hasNext": false
 *   }
 * }
 */

```

### listDynamicItemPages (self-managed)
Self-managed SDK calls require you to [create a client](https://dev.wix.com/docs/sdk/articles/work-with-the-sdk/about-the-wix-client.md).

```javascript
import { createClient } from '@wix/sdk';
import { ricosSiteContext } from '@wix/rich-content';
// Import the auth strategy for the relevant access type
// Import the relevant host module if needed

const myWixClient = createClient ({
  modules: { ricosSiteContext },
  // Include the auth strategy and host as relevant
});


async function listDynamicItemPages(prefix,options) {
  const response = await myWixClient.ricosSiteContext.listDynamicItemPages(prefix,options);
};
```

---