# Posts

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

| **Endpoint**   | **Description**                |
| -------------- | ------------------------------ |
| exportarticles | List of posts from a category. |
| exportarticle  | A post'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 posts from a category

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

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

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

**Parameters:**

| **GET Params**    | **Type**                               | **Required** | **Description**                                                                                                                                                                                                                                                                                                                               |
| ----------------- | -------------------------------------- | ------------ | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| content           | String                                 | Yes          | Equal to "exportarticles".                                                                                                                                                                                                                                                                                                                    |
| callback          | String                                 | Yes          | The callback method.                                                                                                                                                                                                                                                                                                                          |
| categoryId        | Alphanumeric string or         integer | Yes          | The ID of the category.                                                                                                                                                                                                                                                                                                                       |
| lastTimestamp     | Integer                                | No           | Used for implementing the “load more” functionality      for a list of articles. If this   parameter is passed, the     endpoint will return               articles that were                  published before this date.  Usually, the timestamp of    the last displayed article is  used as a parameter for       reading older articles. |
| limit             | Integer                                | No           | The number of articles that are exported for the            category. Default value 7.                                                                                                                                                                                                                                                        |
| descriptionLength | Integer                                | No           | (Deprecated) The length     (number of characters) of an article's description.     Default value 200.                                                                                                                                                                                                                                        |

**Response type**: JSONP

**Response format:**

| **Field** | **Type** | **Required** | **Description**                                                                                     |
| --------- | -------- | ------------ | --------------------------------------------------------------------------------------------------- |
| articles  | List     | Yes          | A list with the articles from the category. Click here to see the specs for an             article. |

## 2) Exporting a post’s full content

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

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

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

**Parameters:**

| **GET Params**    | **Type**                               | **Required** | **Description**                                                                                        |
| ----------------- | -------------------------------------- | ------------ | ------------------------------------------------------------------------------------------------------ |
| content           | String                                 | Yes          | Equal to "exportarticle".                                                                              |
| callback          | String                                 | Yes          | The callback method.                                                                                   |
| articleId         | Alphanumeric string or         integer | Yes          | The ID of the article.                                                                                 |
| descriptionLength | Integer                                | No           | (Deprecated) The length    (number of characters) of  the article’s description.    Default value 200. |

**Response type:**&#x4A;SONP

**Response format:**

| **Field** | **Type** | **Required** | **Description**                                                                                      |
| --------- | -------- | ------------ | ---------------------------------------------------------------------------------------------------- |
| article   | Object   | Yes          | The article's full details.     Click [here](/content-api/posts.md) to see the specs for an article. |

## Post format

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

The **exportcategories** and **exportarticles** endpoints export a list of posts objects. In a similar way, the **exportarticle** endpoint exports the details for a post. Each post object contains the following fields:

| **Field**            | **Type**                               | **Required** | **Description**                                                                                                                                                                                                                       |
| -------------------- | -------------------------------------- | ------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| id                   | Alphanumeric string or integer         | Yes          | The id of the post                                                                                                                                                                                                                    |
| title                | String                                 | Yes          | The title of the post                                                                                                                                                                                                                 |
| author               | String                                 | Yes          | The author's name.                                                                                                                                                                                                                    |
| author\_description  | String                                 | No           | The author's description, it  is exported only by the         **exportarticle** endpoint.                                                                                                                                             |
| author\_avatar       | String                                 | No           | The author's avatar, it is      exported only by the             **exportarticle** endpoint.                                                                                                                                          |
| link                 | String, URL                            | Yes          | The article’s original link    (from the desktop              website). This field is also used to set the                      rel=”canonical” tag on the  post’s details page.                                                      |
| image                | Object or empty string                 | No           | The artucle's featured          image.  In case an article     doesn't have an image, this field is set to " " (empty       string).                                                                                                  |
| date                 | String, datetime                       | Yes          | The date the post was         published, in the site's time zone.                                                                                                                                                                     |
| timestamp            | Integer                                | Yes          | UNIX timestamp with the    post's published date; it is used to order the posts       from newest  to oldest.                                                                                                                         |
| description          | HTML/Text                              | Yes          | The first part from the         article, in HTML format.                                                                                                                                                                              |
| content              | HTML/Text                              | Yes          | The content for the post. It  is set to an empty string     for the exportcategories    and exportarticles                endpoints.                                                                                                  |
| categories           | List                                   | Yes          | A list with all the post's       categories ( a post can      belong to multiple               categories).                                                                                                                           |
| category\_id         | Alphanumeric string or         integer | No           | (Deprecated) The current    visible category ID for the  post. This property is         deprecated and should not be used by new apps.                                                                                                |
| category\_name       | String                                 | No           | (Deprecated) The current      visible category name for    the post. This property is     deprecated and should not  be used by new apps.                                                                                             |
| comment\_status      | String                                 | No           | If comments are opened or closed for the post.            Allowed values are ‘open’, ‘closed’ or ‘disabled’. New comments are allowed only for posts with                      comment\_status = ‘open’. Default value is ‘disabled’. |
| no\_comments         | Integer                                | No           | The number of comments added for the post. Default   value is "0" (zero).                                                                                                                                                             |
| show\_avatars        | Integer                                | No           | If the comments list should display users' avatars. Can be set to "0" (zero) or "1".   Default value is "0" (zero).                                                                                                                   |
| require\_name\_email | Integer                                | No           | If name and email are          required when submitting a new comment. Can be set  to "0" (zero) or "1". Default value is "0" (zero).                                                                                                 |


---

# 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/posts.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.
