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
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 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
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:
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 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. |
Last updated