# Pages

The WP Mobile Pack content API implements a series of endpoints that are responsible for exporting pages. These are as follows:

| **Endpoint** | **Description**          |
| ------------ | ------------------------ |
| exportpages  | A list of all the pages. |
| exportpage   | A page's details.        |

## Please note all endpoints support JSONP.

All URL’s are relative to the WP Mobile Pack installation folder, typically located at /wp-content/plugins/wordpress-mobile-pack.

## 1) Exporting pages

**Relative FREE URL:**/wp-content/plugins/wordpress-mobile-pack/export/content.php?content=exportpages\&callback=CallbackMethod

**Relative PRO URL:**/wp-content/plugins/wordpress-mobile-pack-pro/frontend/export/content.php?content=exportpages\&callback=CallbackMethod

**Sample code:** on [Gist](https://gist.github.com/appticles/d8c82615cc5d90af7f53#file-wpmp-content-api-exportpages)

**Parameters:**

| **GET Params** | **Type** | **Required** | **Description**                                                                                                                                                                                               |
| -------------- | -------- | ------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| content        | String   | Yes          | Equal to "exportpages".                                                                                                                                                                                       |
| callback       | String   | Yes          | The callback method.                                                                                                                                                                                          |
| page           | Integer  | No           | Used for pagination,             indicates the current page of the collection. If missing and rows is set, defaults to 1, otherwise the results are not paginated.                                            |
| rows           | Integer  | No           | Used for pagination,             indicates the maximum      number of items to be         returned per page. If          missing and page is set,     defaults to 5, otherwise the results are not paginated. |
| limit          | Integer  | No           | Deprecated, alias for 'rows'.                                                                                                                                                                                 |

**Response type:** JSONP

**Response format (for a page):**

| **Field**    | **Type**                               | **Required** | **Description**                                                                                                                                                                                                                         |
| ------------ | -------------------------------------- | ------------ | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| id           | Alphanumeric string or         integer | Yes          | The id of the page.                                                                                                                                                                                                                     |
| parent\_id   | Alphanumeric string or         integer | Yes          | The parent page id. It is set  to "0" (zero) for root pages.                                                                                                                                                                            |
| order        | Integer                                | Yes          | The order in the pages        menu.                                                                                                                                                                                                     |
| title        | String                                 | Yes          | The page's title.                                                                                                                                                                                                                       |
| link         | Stringm, URL                           | No           | The page’s link (from the    desktop website). This field is also used to set the         rel=”canonical” tag on the object’s details page.         Default value is “ ” (empty  string) that indicates not to use a rel=canonical tag. |
| image        | Object or empty string                 | No           | The page's featured image. Click [here](/content-api/posts.md) to see the specs for the image field. In case a page doesn't have an        image, this field is set to " " (empty string).                                              |
| has\_content | Integer                                | Yes          | If the page has content        (some pages are usd just    as parent pages to              structure  the menu). Can  be set to "0" (zero) or "1".                                                                                      |
| content      | String                                 | No           | Is equal to " "(empty string).                                                                                                                                                                                                          |

## 2) Exporting a page’s full content

**Relative FREE URL:**/wp-content/plugins/wordpress-mobile-pack/export/content.php?content=exportpage\&pageId=1\&callback=CallbackMethod

**Relative PRO URL:**/wp-content/plugins/wordpress-mobile-pack-pro/frontend/export/content.php?content=exportpage\&pageId=1\&callback=CallbackMethod

**Sample code:** on [Gist](https://gist.github.com/appticles/d8c82615cc5d90af7f53#file-wpmp-content-api-exportpage)

**Parameters:**

| **GET Params** | **Type**                               | **Required** | **Description**        |
| -------------- | -------------------------------------- | ------------ | ---------------------- |
| content        | String                                 | Yes          | Equal to "exportpage". |
| callback       | String                                 | Yes          | The callback method.   |
| pageId         | Alphanumeric string or         integer | Yes          | The ID of the page.    |

**Response type:** JSONP

**Response format:**&#x20;

| **Field**    | **Type**                               | **Required** | **Description**                                                                                                                                                                                                                         |
| ------------ | -------------------------------------- | ------------ | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| id           | Alphanumeric string or         integer | Yes          | The ID of the page.                                                                                                                                                                                                                     |
| parent\_id   | Alphanumeric string or         integer | Yes          | The parent page ID. It is set to "0" (zero) for root pages.                                                                                                                                                                             |
| title        | String                                 | Yes          | The page's title.                                                                                                                                                                                                                       |
| link         | String, URL                            | No           | The page’s link (from the    desktop website). This field is also used to set the         rel=”canonical” tag on the object’s details page.         Default value is “ ” (empty  string) that indicates not to use a rel=canonical tag. |
| image        | Object or empty string.                | No           | The page's featured image. Click[ here](/content-api/posts.md) to see the specs for the image field. In case a page doesn't have an        image, this field is set to " " (empty string).                                              |
| has\_content | Integer                                | Yes          | If the page has content       (some pages are used just as parent pages to              structure the menu). Can    be set to "0" (zero) or "1".                                                                                        |
| content      | HTML/Text                              | Yes          | The page's content in HTML format.                                                                                                                                                                                                      |


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.wpmobilepack.com/content-api/pages.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
