{"id":23566,"date":"2013-05-31T20:03:27","date_gmt":"2013-05-31T20:03:27","guid":{"rendered":"https:\/\/wordpress.org\/plugins-wp\/ideapress-json-api\/"},"modified":"2014-02-06T23:52:19","modified_gmt":"2014-02-06T23:52:19","slug":"ideapress-json-api","status":"publish","type":"plugin","link":"https:\/\/tah.wordpress.org\/plugins\/ideapress-json-api\/","author":12346851,"comment_status":"closed","ping_status":"closed","template":"","meta":{"_crdt_document":"","version":"1.0.0","stable_tag":"trunk","tested":"3.4.2","requires":"2.8","requires_php":"","requires_plugins":"","header_name":"IdeaPress JSON API","header_author":"ideanotion","header_description":"","assets_banners_color":"ffffff","last_updated":"2014-02-06 23:52:19","external_support_url":"","external_repository_url":"","donate_link":"http:\/\/ideanotion.net\/","header_plugin_uri":"","header_author_uri":"http:\/\/ideanotion.net\/","rating":3.7,"author_block_rating":0,"active_installs":80,"downloads":19496,"num_ratings":3,"support_threads":0,"support_threads_resolved":0,"author_block_count":0,"sections":["description","installation","faq","changelog"],"tags":[],"upgrade_notice":{"":"<p>Initial checkin<\/p>"},"ratings":{"1":"1","2":0,"3":0,"4":0,"5":"2"},"assets_icons":[],"assets_banners":{"banner-772x250.png":{"filename":"banner-772x250.png","revision":"852833","resolution":"772x250","location":"assets"}},"assets_blueprints":{},"all_blocks":[],"tagged_versions":[],"block_files":[],"assets_screenshots":{"screenshot-1.png":{"filename":"screenshot-1.png","revision":"1573795","resolution":"1","location":"plugin"}},"screenshots":[],"jetpack_post_was_ever_published":false},"plugin_section":[],"plugin_tags":[1128,896,1156,841,2429],"plugin_category":[],"plugin_contributors":[84805,84806],"plugin_business_model":[],"class_list":["post-23566","plugin","type-plugin","status-publish","hentry","plugin_tags-android","plugin_tags-apps","plugin_tags-ios","plugin_tags-mobile","plugin_tags-mobile-app","plugin_contributors-ideanotion","plugin_contributors-michaelsiu","plugin_committers-michaelsiu"],"banners":{"banner":"https:\/\/ps.w.org\/ideapress-json-api\/assets\/banner-772x250.png?rev=852833","banner_2x":false,"banner_rtl":false,"banner_2x_rtl":false},"icons":{"svg":false,"icon":"https:\/\/s.w.org\/plugins\/geopattern-icon\/ideapress-json-api_ffffff.svg","icon_2x":false,"generated":true},"screenshots":[{"src":"https:\/\/ps.w.org\/ideapress-json-api\/trunk\/screenshot-1.png?rev=1573795","caption":""}],"raw_content":"<!--section=description-->\n<p><a href=\"http:\/\/ideapress.me\/turn-wordpress-into-mobile-app.html\">IdeaPress<\/a> convert your wordpress (both wordpress.com and self hosted site) <strong>into Android, iOS, winphone and windows app!<\/strong> It is used to compliment Ideapress multi-screen application.<\/p>\n\n<h3>About IdeaPress<\/h3>\n\n<p>IdeaPress aims to make the mobile app space more accessible to everyone by providing an avenue for coders and non-coders to develop beautiful apps.<\/p>\n\n<p>IdeaPress has been endorsed by Microsoft CANADA and it is used by magazines and wordpress shop around the world. It has been showcase in WordCamp 2013 DemoCamp, StartUpTO, DevTO. If you want to turn your wordpress site into iOS, Android and WinPhone, it might be the tool for you.<\/p>\n\n<h3>Build your own mobile app<\/h3>\n\n<p><a href=\"http:\/\/ideapress.me\/turn-wordpress-into-mobile-app.html\">IdeaPress<\/a> is an online that convert your site into moible app in 3 steps. WordPress is best known for its <strong>ease-of-use and customization<\/strong> options. When you're <strong>making your iOS, Android and Winphone apps<\/strong> with IdeaPress, you get to choose exactly how you want to make your app ranging from the content that's included to the <strong>design and styling<\/strong>. In addition, we will help you publish to app store.<\/p>\n\n<h3>Features<\/h3>\n\n<p>IdeaPress comes with loads of features out of the box<\/p>\n\n<ul>\n<li><h4>Offline Browsing<\/h4>\n<p>Tired of not being able to read your content you have <strong>no internet<\/strong>? Solve the problem with IdeaPress! IdeaPress stores the content of your website so that it can be accessed on mobile devices anytime, anywhere!<\/p>\n<\/li>\n<li><h4>Posts and Pages<\/h4>\n<p>Choose which <strong>categories and pages<\/strong> you want to include in your apps and even choose different content for platforms, whether it be iOS, Android or Windows Phone. IdeaPress format your content to fit on all devices, so your <strong>posts and pages look good on the go<\/strong>!<\/p>\n<\/li>\n<li><h4>Bookmarking, Sharing and Searching<\/h4>\n<p>One of the main reasons to get an app over a mobile website is to take advantage of device native features. IdeaPress apps can harness the power of the devices that they are on across all platforms and let users <strong>search the content of your website, share posts and pages and bookmark articles<\/strong> for later viewing.<\/p>\n<\/li>\n<li><h4>Dynamic updating<\/h4>\n<p>While most apps have to be resubmitted to the store when updating, IdeaPress apps can be updated through your dashboard and have <strong>the changes pushed directly to the apps withing minutes without re-publishing<\/strong>. Users get to benefit from your changes almost instantly instead of waiting for store certification.<\/p>\n<\/li>\n\n<\/ul>\n\n<p>This plugin is developed by <a href=\"http:\/\/ideanotion.net\">Idea Notion<\/a><\/p>\n\n<p>This plugin is developed base on JSON-API, it will add additional functionality to the original JSON API, slim down the return objects and add additional functionality for Ideapress applications<\/p>\n\n<h3>Documentation<\/h3>\n\n<p>This plugin base on Wordpress JSON-API plugin and we modified the plugin to taylor the need of Ideapress multi-screen application. Most of the methods are supported, an additional get_recent_posts_on_hub is being added for smaller return size and Posts Control is dropped. The rest of this section is base on JSON-API documentation.<\/p>\n\n<ol>\n<li>General concepts<br \/>\n1.1. Requests<br \/>\n1.2. Controllers<br \/>\n1.3. Responses  <\/li>\n<li>Request methods<br \/>\n2.1. Core controller methods<br \/>\n2.2. Respond controller methods  <\/li>\n<li>Request arguments<br \/>\n3.1. Output-modifying arguments<br \/>\n3.2. Content-modifying arguments<br \/>\n3.3. Using include\/exclude and redirects  <\/li>\n<li>Response objects<br \/>\n4.1. Post response object<br \/>\n4.2. Category response object<br \/>\n4.3. Tag response object<br \/>\n4.4. Author response object<br \/>\n4.4. Comment response object<br \/>\n4.5. Attachment response object<\/li>\n<\/ol>\n\n<h3>1. General Concepts<\/h3>\n\n<h3>1.1. Requests<\/h3>\n\n<p>Requests use a simple REST-style HTTP GET or POST. To invoke the API, include a non-empty query value for <code>json<\/code> in the URL.<\/p>\n\n<p>JSON API operates in two modes:<\/p>\n\n<ol>\n<li><em>Implicit mode<\/em> is triggered by setting the <code>json<\/code> query var to a non-empty value on any WordPress page. The content that would normally appear on that page is returned in JSON format.<\/li>\n<li><em>Explicit mode<\/em> is triggered by setting <code>json<\/code> to a known method string. See <em>Section 2: Request methods<\/em> for a complete method listing.<\/li>\n<\/ol>\n\n<h4>Implicit mode examples:<\/h4>\n\n<ul>\n<li><code>http:\/\/www.example.org\/?json=1<\/code><\/li>\n<li><code>http:\/\/www.example.org\/?p=47&amp;json=1<\/code><\/li>\n<li><code>http:\/\/www.example.org\/tag\/banana\/?json=1<\/code><\/li>\n<\/ul>\n\n<h4>Explicit mode examples:<\/h4>\n\n<ul>\n<li><code>http:\/\/www.example.org\/?json=get_recent_posts<\/code><\/li>\n<li><code>http:\/\/www.example.org\/?json=get_post&amp;post_id=47<\/code><\/li>\n<li><code>http:\/\/www.example.org\/?json=get_tag_posts&amp;tag_slug=banana<\/code><\/li>\n<\/ul>\n\n<h4>With user-friendly permalinks configured:<\/h4>\n\n<ul>\n<li><code>http:\/\/www.example.org\/api\/get_recent_posts\/<\/code><\/li>\n<li><code>http:\/\/www.example.org\/api\/get_post\/?post_id=47<\/code><\/li>\n<li><code>http:\/\/www.example.org\/api\/get_tag_posts\/?tag_slug=banana<\/code><\/li>\n<\/ul>\n\n<p><strong>Further reading<\/strong><br \/>\nSee <em>Section 3: Request arguments<\/em> for more information about request arguments to modify the response.<\/p>\n\n<h3>1.2. Controllers<\/h3>\n\n<p>The 1.0 release of JSON API introduced a modular controller system. This allows developers to flexibly add features to the API and give users more control over which methods they have enabled.<\/p>\n\n<h4>The Core controller<\/h4>\n\n<p>Most of the methods available prior to version 1.0 have been moved to the Core controller. The two exceptions are <code>submit_comment<\/code> and <code>create_post<\/code> which are now available from the Respond and Posts controllers, respectively. The Core controller is the only one enabled by default. All other functionality must be enabled from the JSON API Settings page (under Settings in the WordPress admin menu).<\/p>\n\n<h4>Specifying a controller<\/h4>\n\n<p>There are a few ways of specifying a controller, depending on how you are calling the API:<\/p>\n\n<ul>\n<li><code>http:\/\/www.example.org\/?json=get_recent_posts<\/code> (<code>core<\/code> controller is implied, method is <code>get_recent_posts<\/code>)<\/li>\n<li><code>http:\/\/www.example.org\/api\/info\/<\/code> (<code>core<\/code> controller is implied)<\/li>\n<li><code>http:\/\/www.example.org\/api\/core\/get_category_posts\/<\/code> (<code>core<\/code> controller can also be explicitly specified)<\/li>\n<li><code>http:\/\/www.example.org\/?json=respond.submit_comment<\/code> (<code>respond<\/code> controller, <code>submit_comment<\/code> method)<\/li>\n<\/ul>\n\n<p><strong>Legacy compatibility<\/strong><br \/>\nJSON API retains support for its pre-1.0 methods. For example, if you invoke the method <code>create_post<\/code> without a controller specified, the Posts controller is chosen instead of Core.<\/p>\n\n<h4>Available controllers<\/h4>\n\n<p>The current release includes three controllers: Core, Posts, and Respond. Developers are encouraged to suggest or submit additional controllers.<\/p>\n\n<p><strong>Further reading<\/strong><br \/>\nSee <em>Section 2: Request methods<\/em> for a complete reference of available controllers and methods. For documentation on extending JSON API with new controllers see <em>Section 5.2: Developing JSON API controllers<\/em>.<\/p>\n\n<h3>1.3. Responses<\/h3>\n\n<p>The standard response format for JSON API is (as you may have guessed) <a href=\"http:\/\/json.org\/\">JSON<\/a>.<\/p>\n\n<p>Here is an example response from <code>http:\/\/localhost\/wordpress\/?json=1<\/code> called on a default WordPress installation (formatted for readability):<\/p>\n\n<pre><code>{\n  \"status\": \"ok\",\n  \"count\": 1,\n  \"count_total\": 1,\n  \"pages\": 1,\n  \"posts\": [\n    {\n      \"id\": 1,\n      \"type\": \"post\",\n      \"slug\": \"hello-world\",\n      \"url\": \"http:\\\/\\\/localhost\\\/wordpress\\\/?p=1\",\n      \"title\": \"Hello world!\",\n      \"title_plain\": \"Hello world!\",\n      \"content\": \"&lt;p&gt;Welcome to WordPress. This is your first post. Edit or delete it, then start blogging!&lt;\\\/p&gt;\\n\",\n      \"excerpt\": \"Welcome to WordPress. This is your first post. Edit or delete it, then start blogging!\\n\",\n      \"date\": \"2009-11-11 12:50:19\",\n      \"modified\": \"2009-11-11 12:50:19\",\n      \"categories\": [],\n      \"tags\": [],\n      \"author\": {\n        \"id\": 1,\n        \"slug\": \"admin\",\n        \"name\": \"admin\",\n        \"first_name\": \"\",\n        \"last_name\": \"\",\n        \"nickname\": \"\",\n        \"url\": \"\",\n        \"description\": \"\"\n      },\n      \"comments\": [\n        {\n          \"id\": 1,\n          \"name\": \"Mr WordPress\",\n          \"url\": \"http:\\\/\\\/wordpress.org\\\/\",\n          \"date\": \"2009-11-11 12:50:19\",\n          \"content\": \"&lt;p&gt;Hi, this is a comment.&lt;br \\\/&gt;To delete a comment, just log in and view the post&#039;s comments. There you will have the option to edit or delete them.&lt;\\\/p&gt;\\n\",\n          \"parent\": 0\n        }\n      ],\n      \"comment_count\": 1,\n      \"comment_status\": \"open\"\n    }\n  ]\n}&lt;h3&gt;2. Request methods&lt;\/h3&gt;\n<\/code><\/pre>\n\n<p>Request methods are available from the following controllers:<\/p>\n\n<ul>\n<li>Core controller - basic introspection methods<\/li>\n<li>Posts controller - data manipulation methods for posts<\/li>\n<li>Respond controller - comment\/trackback submission methods<\/li>\n<\/ul>\n\n<h3>2.1. Core controller methods<\/h3>\n\n<p>The Core controller offers a mostly-complete set of introspection methods for retrieving content from WordPress.<\/p>\n\n<h3>Method: info<\/h3>\n\n<p>Returns information about JSON API.<\/p>\n\n<h4>Optional arguments<\/h4>\n\n<ul>\n<li><code>controller<\/code> - returns detailed information about a specific controller<\/li>\n<\/ul>\n\n<h4>Response<\/h4>\n\n<pre><code>{\n  \"status\": \"ok\",\n  \"json_api_version\": \"1.0\",\n  \"controllers\": [\n    \"core\"\n  ]\n}\n<\/code><\/pre>\n\n<h4>Response<\/h4>\n\n<pre><code>{\n  \"status\": \"ok\",\n  \"name\": \"Core\",\n  \"description\": \"Basic introspection methods\",\n  \"methods\": [\n    ...\n  ]\n}&lt;h3&gt;Method: get_recent_posts&lt;\/h3&gt;\n<\/code><\/pre>\n\n<p>Returns an array of recent posts. You can invoke this from the WordPress home page either by setting <code>json<\/code> to a non-empty value (i.e., <code>json=1<\/code>) or from any page by setting <code>json=get_recent_posts<\/code>.<\/p>\n\n<h4>Optional arguments<\/h4>\n\n<ul>\n<li><code>count<\/code> - determines how many posts per page are returned (default value is 10)<\/li>\n<li><code>page<\/code> - return a specific page number from the results<\/li>\n<li><code>post_type<\/code> - used to retrieve custom post types<\/li>\n<\/ul>\n\n<h4>Response<\/h4>\n\n<pre><code>{\n  \"status\": \"ok\",\n  \"count\": 10,\n  \"count_total\": 79,\n  \"pages\": 7,\n  \"posts\": [\n    { ... },\n    { ... },\n    ...\n  ]\n}&lt;h3&gt;Method: get_recent_posts_on_hub&lt;\/h3&gt;\n<\/code><\/pre>\n\n<p>Returns an array of recent posts. You can invoke this from any page by setting <code>json=get_recent_posts_on_hub<\/code>. This function slims down the content because on hub page, multi-screen app doesn't need the full content and it remove the return comments to decrease the size of return item.<\/p>\n\n<h4>Optional arguments<\/h4>\n\n<ul>\n<li><code>count<\/code> - determines how many posts per page are returned (default value is 10)<\/li>\n<li><code>page<\/code> - return a specific page number from the results<\/li>\n<li><code>post_type<\/code> - used to retrieve custom post types<\/li>\n<\/ul>\n\n<h4>Response<\/h4>\n\n<pre><code>{\n  \"status\": \"ok\",\n  \"count\": 10,\n  \"count_total\": 79,\n  \"pages\": 7,\n  \"posts\": [\n    { ... },\n    { ... },\n    ...\n  ]\n}&lt;h3&gt;Method: ideapress_server_ping&lt;\/h3&gt;Returns true. Make sure the the server has installed the plugin\n<\/code><\/pre>\n\n<h4>Response<\/h4>\n\n<pre><code>{\n  \"status\": \"ok\",\n  \"result\": true\n}&lt;h3&gt;Method: get_post&lt;\/h3&gt;\n<\/code><\/pre>\n\n<p>Returns a single post object.<\/p>\n\n<h4>One of the following is required<\/h4>\n\n<ul>\n<li>Invoking the JSON API implicitly (i.e., <code>?json=1<\/code>) on a post URL<\/li>\n<li><code>id<\/code> or <code>post_id<\/code> - set to the post's ID<\/li>\n<li><code>slug<\/code> or <code>post_slug<\/code> - set to the post's URL slug<\/li>\n<\/ul>\n\n<h4>Optional arguments<\/h4>\n\n<ul>\n<li><code>post_type<\/code> - used to retrieve custom post types<\/li>\n<\/ul>\n\n<h4>Response<\/h4>\n\n<pre><code>{\n  \"status\": \"ok\",\n  \"post\": { ... }\n}&lt;h3&gt;Method: get_page&lt;\/h3&gt;\n<\/code><\/pre>\n\n<p>Returns a single page object.<\/p>\n\n<h4>One of the following is required<\/h4>\n\n<ul>\n<li>Invoking the JSON API implicitly (i.e., <code>?json=1<\/code>) on a page URL<\/li>\n<li><code>id<\/code> or <code>page_id<\/code> - set to the page's ID<\/li>\n<li><code>slug<\/code> or <code>page_slug<\/code> - set to the page's URL slug<\/li>\n<\/ul>\n\n<h4>Optional arguments<\/h4>\n\n<ul>\n<li><code>children<\/code> - set to a non-empty value to include a recursive hierarchy of child pages<\/li>\n<li><code>post_type<\/code> - used to retrieve custom post types<\/li>\n<\/ul>\n\n<h4>Response<\/h4>\n\n<pre><code>{\n  \"status\": \"ok\",\n  \"page\": { ... }\n}&lt;h3&gt;Method: get_date_posts&lt;\/h3&gt;\n<\/code><\/pre>\n\n<p>Returns an array of posts\/pages in a specific date archive (by day, month, or year).<\/p>\n\n<h4>One of the following is required<\/h4>\n\n<ul>\n<li>Invoking the JSON API implicitly (i.e., <code>?json=1<\/code>) on a date archive page<\/li>\n<li><code>date<\/code> - set to a date in the format <code>YYYY<\/code> or <code>YYYY-MM<\/code> or <code>YYYY-MM-DD<\/code> (non-numeric characters are stripped from the var, so <code>YYYYMMDD<\/code> or <code>YYYY\/MM\/DD<\/code> are also valid)<\/li>\n<\/ul>\n\n<h4>Optional arguments<\/h4>\n\n<ul>\n<li><code>count<\/code> - determines how many posts per page are returned (default value is 10)<\/li>\n<li><code>page<\/code> - return a specific page number from the results<\/li>\n<li><code>post_type<\/code> - used to retrieve custom post types<\/li>\n<\/ul>\n\n<h4>Response<\/h4>\n\n<pre><code>{\n  \"status\": \"ok\",\n  \"count\": 10,\n  \"count_total\": 79,\n  \"pages\": 7,\n  \"posts\": [\n    { ... },\n    { ... },\n    ...\n  ]\n}&lt;h3&gt;Method: get_category_posts&lt;\/h3&gt;\n<\/code><\/pre>\n\n<p>Returns an array of posts\/pages in a specific category.<\/p>\n\n<h4>One of the following is required<\/h4>\n\n<ul>\n<li>Invoking the JSON API implicitly (i.e., <code>?json=1<\/code>) on a category archive page<\/li>\n<li><code>id<\/code> or <code>category_id<\/code> - set to the category's ID<\/li>\n<li><code>slug<\/code> or <code>category_slug<\/code> - set to the category's URL slug<\/li>\n<\/ul>\n\n<h4>Optional arguments<\/h4>\n\n<ul>\n<li><code>count<\/code> - determines how many posts per page are returned (default value is 10)<\/li>\n<li><code>page<\/code> - return a specific page number from the results<\/li>\n<li><code>post_type<\/code> - used to retrieve custom post types<\/li>\n<\/ul>\n\n<h4>Response<\/h4>\n\n<pre><code>{\n  \"status\": \"ok\",\n  \"count\": 10,\n  \"count_total\": 79,\n  \"pages\": 7,\n  \"category\": { ... }\n  \"posts\": [\n    { ... },\n    { ... },\n    ...\n  ]\n}&lt;h3&gt;Method: get_tag_posts&lt;\/h3&gt;\n<\/code><\/pre>\n\n<p>Returns an array of posts\/pages with a specific tag.<\/p>\n\n<h4>One of the following is required<\/h4>\n\n<ul>\n<li>Invoking the JSON API implicitly (i.e., <code>?json=1<\/code>) on a tag archive page<\/li>\n<li><code>id<\/code> or <code>tag_id<\/code> - set to the tag's ID<\/li>\n<li><code>slug<\/code> or <code>tag_slug<\/code> - set to the tag's URL slug<\/li>\n<\/ul>\n\n<h4>Optional arguments<\/h4>\n\n<ul>\n<li><code>count<\/code> - determines how many posts per page are returned (default value is 10)<\/li>\n<li><code>page<\/code> - return a specific page number from the results<\/li>\n<li><code>post_type<\/code> - used to retrieve custom post types<\/li>\n<\/ul>\n\n<h4>Response<\/h4>\n\n<pre><code>{\n  \"status\": \"ok\",\n  \"count\": 10,\n  \"count_total\": 79,\n  \"pages\": 7,\n  \"tag\": { ... }\n  \"posts\": [\n    { ... },\n    { ... },\n    ...\n  ]\n}&lt;h3&gt;Method: get_author_posts&lt;\/h3&gt;\n<\/code><\/pre>\n\n<p>Returns an array of posts\/pages written by a specific author.<\/p>\n\n<h4>One of the following is required<\/h4>\n\n<ul>\n<li>Invoking the JSON API implicitly (i.e., <code>?json=1<\/code>) on an author archive page<\/li>\n<li><code>id<\/code> or <code>author_id<\/code> - set to the author's ID<\/li>\n<li><code>slug<\/code> or <code>author_slug<\/code> - set to the author's URL slug<\/li>\n<\/ul>\n\n<h4>Optional arguments<\/h4>\n\n<ul>\n<li><code>count<\/code> - determines how many posts per page are returned (default value is 10)<\/li>\n<li><code>page<\/code> - return a specific page number from the results<\/li>\n<li><code>post_type<\/code> - used to retrieve custom post types<\/li>\n<\/ul>\n\n<h4>Response<\/h4>\n\n<pre><code>{\n  \"status\": \"ok\",\n  \"count\": 10,\n  \"count_total\": 79,\n  \"pages\": 7,\n  \"author\": { ... }\n  \"posts\": [\n    { ... },\n    { ... },\n    ...\n  ]\n}&lt;h3&gt;Method: get_search_results&lt;\/h3&gt;\n<\/code><\/pre>\n\n<p>Returns an array of posts\/pages in response to a search query.<\/p>\n\n<h4>One of the following is required<\/h4>\n\n<ul>\n<li>Invoking the JSON API implicitly (i.e., <code>?json=1<\/code>) on a search results page<\/li>\n<li><code>search<\/code> - set to the desired search query<\/li>\n<\/ul>\n\n<h4>Optional arguments<\/h4>\n\n<ul>\n<li><code>count<\/code> - determines how many posts per page are returned (default value is 10)<\/li>\n<li><code>page<\/code> - return a specific page number from the results<\/li>\n<li><code>post_type<\/code> - used to retrieve custom post types<\/li>\n<\/ul>\n\n<h4>Response<\/h4>\n\n<pre><code>{\n  \"status\": \"ok\",\n  \"count\": 10,\n  \"count_total\": 79,\n  \"pages\": 7,\n  \"posts\": [\n    { ... },\n    { ... },\n    ...\n  ]\n}&lt;h3&gt;Method: get_date_index&lt;\/h3&gt;\n<\/code><\/pre>\n\n<p>Returns both an array of date page permalinks and a tree structure representation of the archive.<\/p>\n\n<h4>Response<\/h4>\n\n<pre><code>{\n  \"status\": \"ok\",\n  \"permalinks\": [\n    \"...\",\n    \"...\",\n    \"...\"\n  ],\n  \"tree\": {\n    \"2009\": {\n      \"09\": 17,\n      \"10\": 20,\n      \"11\": 7\n    }\n  }\n<\/code><\/pre>\n\n<p>Note: the tree is arranged by <code>response.tree.[year].[month].[number of posts]<\/code>.<\/p>\n\n<h3>Method: get_category_index<\/h3>\n\n<p>Returns an array of active categories.<\/p>\n\n<h4>Response<\/h4>\n\n<pre><code>{\n  \"status\": \"ok\",\n  \"count\": 3,\n  \"categories\": [\n    { ... },\n    { ... },\n    { ... }\n  ]\n}&lt;h3&gt;Method: get_tag_index&lt;\/h3&gt;\n<\/code><\/pre>\n\n<p>Returns an array of active tags.<\/p>\n\n<h4>Response<\/h4>\n\n<pre><code>{\n  \"status\": \"ok\",\n  \"count\": 3\n  \"tags\": [\n    { ... },\n    { ... },\n    { ... }\n  ]\n}&lt;h3&gt;Method: get_author_index&lt;\/h3&gt;\n<\/code><\/pre>\n\n<p>Returns an array of active blog authors.<\/p>\n\n<h4>Response<\/h4>\n\n<pre><code>{\n  \"status\": \"ok\",\n  \"count\": 3,\n  \"authors\": [\n    { ... },\n    { ... },\n    { ... }\n  ]\n}&lt;h3&gt;Method: get_page_index&lt;\/h3&gt;\n<\/code><\/pre>\n\n<p>Returns a hierarchical tree of <code>page<\/code> posts.<\/p>\n\n<h4>Response<\/h4>\n\n<pre><code>{\n  \"status\": \"ok\",\n  \"pages\": [\n    { ... },\n    { ... },\n    { ... }\n  ]\n}&lt;h3&gt;Method: get_nonce&lt;\/h3&gt;\n<\/code><\/pre>\n\n<p>Returns a WordPress nonce value, required to call some data manipulation methods.<\/p>\n\n<h4>Required arguments<\/h4>\n\n<ul>\n<li><code>controller<\/code> - the JSON API controller for the method you will use the nonce for<\/li>\n<li><code>method<\/code> - the method you wish to call (currently <code>create_post<\/code> is the only method that requires a nonce)<\/li>\n<\/ul>\n\n<h4>Response<\/h4>\n\n<pre><code>{\n  \"status\": \"ok\",\n  \"controller\": \"posts\",\n  \"method\": \"create_post\",\n  \"nonce\": \"cefe01efd4\"\n}\n<\/code><\/pre>\n\n<p><strong>Further reading<\/strong><br \/>\nTo learn more about how nonces are used in WordPress, see <a href=\"http:\/\/markjaquith.wordpress.com\/2006\/06\/02\/wordpress-203-nonces\/\">Mark Jaquith's article on the subject<\/a>.<\/p>\n\n<h3>2.2. Pages controller methods<\/h3>\n\n<h3>Method: create_post<\/h3>\n\n<p>Creates a new post.<\/p>\n\n<h4>Required argument<\/h4>\n\n<ul>\n<li><code>nonce<\/code> - available from the <code>get_nonce<\/code> method (call with vars <code>controller=posts<\/code> and <code>method=create_post<\/code>)<\/li>\n<\/ul>\n\n<h4>Optional arguments<\/h4>\n\n<ul>\n<li><code>status<\/code> - sets the post status (\"draft\" or \"publish\"), default is \"draft\"<\/li>\n<li><code>title<\/code> - the post title<\/li>\n<li><code>content<\/code> - the post content<\/li>\n<li><code>author<\/code> - the post's author (login name), default is the current logged in user<\/li>\n<li><code>categories<\/code> - a comma-separated list of categories (URL slugs)<\/li>\n<li><code>tags<\/code> - a comma-separated list of tags (URL slugs)<\/li>\n<\/ul>\n\n<p>Note: including a file upload field called <code>attachment<\/code> will cause an attachment to be stored with your new post.<\/p>\n\n<h3>2.3. Respond controller methods<\/h3>\n\n<h3>Method: submit_comment<\/h3>\n\n<p>Submits a comment to a WordPress post.<\/p>\n\n<h4>Required arguments<\/h4>\n\n<ul>\n<li><code>post_id<\/code> - which post to comment on<\/li>\n<li><code>name<\/code> - the commenter's name<\/li>\n<li><code>email<\/code> - the commenter's email address<\/li>\n<li><code>content<\/code> - the comment content<\/li>\n<\/ul>\n\n<h4>Optional arguments<\/h4>\n\n<ul>\n<li><code>redirect<\/code> - redirect instead of returning a JSON object<\/li>\n<li><code>redirect_ok<\/code> - redirect to a specific URL when the status value is <code>ok<\/code><\/li>\n<li><code>redirect_error<\/code> - redirect to a specific URL when the status value is <code>error<\/code><\/li>\n<li><code>redirect_pending<\/code> - redirect to a specific URL when the status value is <code>pending<\/code><\/li>\n<\/ul>\n\n<h4>Custom status values<\/h4>\n\n<ul>\n<li><code>pending<\/code> - assigned if the comment submission is pending moderation<\/li>\n<\/ul>\n\n<h3>3. Request arguments<\/h3>\n\n<p>API requests can be controlled by specifying one of the following arguments as URL query vars.<\/p>\n\n<h4>Examples<\/h4>\n\n<ul>\n<li>Debug the response: <code>http:\/\/www.example.org\/api\/get_page_index\/?dev=1<\/code><\/li>\n<li>Widget-style JSONP output: <code>http:\/\/www.example.org\/api\/get_recent_posts\/?callback=show_posts_widget&amp;read_more=More&amp;count=3<\/code><\/li>\n<li>Redirect on error: <code>http:\/\/www.example.org\/api\/posts\/create_post\/?callback_error=http%3A%2F%2Fwww.example.org%2Fhelp.html<\/code><\/li>\n<\/ul>\n\n<h3>3.1. Output-modifying arguments<\/h3>\n\n<p>The following arguments modify how you get results back from the API. The redirect response styles are intended for use with the data manipulation methods.<\/p>\n\n<ul>\n<li>Setting <code>callback<\/code> to a JavaScript function name will trigger a JSONP-style callback.<\/li>\n<li>Setting <code>redirect<\/code> to a URL will cause the user's browser to redirect to the specified URL with a <code>status<\/code> value appended to the query vars (see the <em>Response objects<\/em> section below for an explanation of status values).<\/li>\n<li>Setting <code>redirect_[status]<\/code> allows you to control the resulting browser redirection depending on the <code>status<\/code> value.<\/li>\n<li>Setting <code>dev<\/code> to a non-empty value adds whitespace for readability and responds with <code>text\/plain<\/code><\/li>\n<li>Omitting all of the above arguments will result in a standard JSON response.<\/li>\n<\/ul>\n\n<h3>3.2. Content-modifying arguments<\/h3>\n\n<p>These arguments are available to modify all introspection methods:<\/p>\n\n<ul>\n<li><code>date_format<\/code> - Changes the format of date values. Uses the same syntax as PHP's date() function. Default value is <code>Y-m-d H:i:s<\/code>.<\/li>\n<li><code>read_more<\/code> - Changes the 'read more' link text in post content.<\/li>\n<li><code>include<\/code> - Specifies which post data fields to include. Expects a comma-separated list of post fields. Leaving this empty includes <em>all<\/em> fields.<\/li>\n<li><code>exclude<\/code> - Specifies which post data fields to exclude. Expects a comma-separated list of post fields.<\/li>\n<li><code>custom_fields<\/code> - Includes values from posts' Custom Fields. Expects a comma-separated list of custom field keys.<\/li>\n<li><code>author_meta<\/code> - Includes additional author metadata. Should be a comma-separated list of metadata fields.<\/li>\n<li><code>count<\/code> - Controls the number of posts to include (defaults to the number specified by WordPress)<\/li>\n<li><code>order<\/code> - Controls the order of post results ('DESC' or 'ASC'). Default value is 'DESC'.<\/li>\n<li><code>order_by<\/code> - Controls which field to order results by. Expects one of the following values:\n\n<ul>\n<li><code>author<\/code><\/li>\n<li><code>date<\/code> (default value)<\/li>\n<li><code>title<\/code><\/li>\n<li><code>modified<\/code><\/li>\n<li><code>menu_order<\/code> (only works with Pages)<\/li>\n<li><code>parent<\/code><\/li>\n<li><code>ID<\/code><\/li>\n<li><code>rand<\/code><\/li>\n<li><code>meta_value<\/code> (<code>meta_key<\/code> must also be set)<\/li>\n<li><code>none<\/code><\/li>\n<li><code>comment_count<\/code><\/li>\n<\/ul><\/li>\n<li><code>meta_key<\/code>, <code>meta_value<\/code>, <code>meta_compare<\/code> - Retrieve posts (or Pages) based on a custom field key or value.<\/li>\n<\/ul>\n\n<h3>3.3. Using include\/exclude and redirects<\/h3>\n\n<p><strong>About <code>include<\/code>\/<code>exclude<\/code> arguments<\/strong><br \/>\nBy default you get all values included with each post object. Specify a list of <code>include<\/code> values will cause the post object to filter out the values absent from the list. Specifying <code>exclude<\/code> causes post objects to include all values except the fields you list. For example, the query <code>exclude=comments<\/code> includes everything <em>except<\/em> the comments.<\/p>\n\n<p><strong>About the <code>redirect<\/code> argument<\/strong><br \/>\nThe <code>redirect<\/code> response style is useful for when you need the user's browser to make a request directly rather than making proxy requests using a tool like cURL. Setting a <code>redirect<\/code> argument causes the user's browser to redirect back to the specified URL instead of returning a JSON object. The resulting <code>status<\/code> value is included as an extra query variable.<\/p>\n\n<p>For example calling an API method with <code>redirect<\/code> set to <code>http:\/\/www.example.com\/foo<\/code> will result in a redirection to one of the following:<\/p>\n\n<ul>\n<li><code>http:\/\/www.example.com\/foo?status=ok<\/code><\/li>\n<li><code>http:\/\/www.example.com\/foo?status=error<\/code><\/li>\n<\/ul>\n\n<p>You can also set separate URLs to handle status values differently. You could set <code>redirect_ok<\/code> to <code>http:\/\/www.example.com\/handle_ok<\/code> and <code>redirect_error<\/code> to <code>http:\/\/www.example.com\/handle_error<\/code> in order to have more fine-tuned control over the method result.<\/p>\n\n<h3>4. Response objects<\/h3>\n\n<p>This section describes data objects you can retrieve from WordPress and the optional URL redirects.<\/p>\n\n<p><strong>Status values<\/strong><br \/>\nAll JSON API requests result in a status value. The two basic status values are <code>ok<\/code> and <code>error<\/code>. Additional status values are available for certain methods (such as <code>pending<\/code> in the case of the <code>submit_comment<\/code> method). API methods that result in custom status values include a <em>custom status values<\/em> section in their documentation.<\/p>\n\n<p><strong>Naming compatibility<\/strong><br \/>\nDevelopers familiar with WordPress may notice that many names for properties and arguments have been changed. This was a stylistic choice that intends to provide more clarity and consistency in the interface.<\/p>\n\n<h3>4.1. Post response object<\/h3>\n\n<ul>\n<li><code>id<\/code> - Integer<\/li>\n<li><code>type<\/code> - String (e.g., <code>post<\/code> or <code>page<\/code>)<\/li>\n<li><code>slug<\/code> - String<\/li>\n<li><code>url<\/code> - String<\/li>\n<li><code>title<\/code> - String<\/li>\n<li><code>title_plain<\/code> - String<\/li>\n<li><code>content<\/code> - String (modified by the <code>read_more<\/code> argument)<\/li>\n<li><code>excerpt<\/code> - String<\/li>\n<li><code>date<\/code> - String (modified by the <code>date_format<\/code> argument)<\/li>\n<li><code>modified<\/code> - String (modified by the <code>date_format<\/code> argument)<\/li>\n<li><code>categories<\/code> - Array of category objects<\/li>\n<li><code>tags<\/code> - Array of tag objects<\/li>\n<li><code>author<\/code> Author object<\/li>\n<li><code>comments<\/code> - Array of comment objects<\/li>\n<li><code>attachments<\/code> - Array of attachment objects<\/li>\n<li><code>comment_count<\/code> - Integer<\/li>\n<li><code>comment_status<\/code> - String (<code>\"open\"<\/code> or <code>\"closed\"<\/code>)<\/li>\n<li><code>thumbnail<\/code> - String (only included if a post thumbnail has been specified)<\/li>\n<li><code>custom_fields<\/code> - Object (included by setting the <code>custom_fields<\/code> argument to a comma-separated list of custom field names)<\/li>\n<\/ul>\n\n<p><strong>Note<\/strong><br \/>\nThe <code>thumbnail<\/code> attribute returns a URL to the image size specified by the optional <code>thumbnail_size<\/code> request argument. By default this will use the <code>thumbnail<\/code> or <code>post-thumbnail<\/code> sizes, depending on your version of WordPress. See <a href=\"http:\/\/markjaquith.wordpress.com\/2009\/12\/23\/new-in-wordpress-2-9-post-thumbnail-images\/\">Mark Jaquith's post on the topic<\/a> for more information.<\/p>\n\n<h3>4.2. Category response object<\/h3>\n\n<ul>\n<li><code>id<\/code> - Integer<\/li>\n<li><code>slug<\/code> - String<\/li>\n<li><code>title<\/code> - String<\/li>\n<li><code>description<\/code> - String<\/li>\n<li><code>parent<\/code> - Integer<\/li>\n<li><code>post_count<\/code> - Integer<\/li>\n<\/ul>\n\n<h3>4.3. Tag response object<\/h3>\n\n<ul>\n<li><code>id<\/code> - Integer<\/li>\n<li><code>slug<\/code> - String<\/li>\n<li><code>title<\/code> - String<\/li>\n<li><code>description<\/code> - String<\/li>\n<li><code>post_count<\/code> - Integer<\/li>\n<\/ul>\n\n<h3>4.4. Author response object<\/h3>\n\n<ul>\n<li><code>id<\/code> - Integer<\/li>\n<li><code>slug<\/code> - String<\/li>\n<li><code>name<\/code> - String<\/li>\n<li><code>first_name<\/code> - String<\/li>\n<li><code>last_name<\/code> - String<\/li>\n<li><code>nickname<\/code> - String<\/li>\n<li><code>url<\/code> - String<\/li>\n<li><code>description<\/code> - String<\/li>\n<\/ul>\n\n<p>Note: You can include additional values by setting the <code>author_meta<\/code> argument to a comma-separated list of metadata fields.<\/p>\n\n<h3>4.5. Comment response object<\/h3>\n\n<ul>\n<li><code>id<\/code> - Integer<\/li>\n<li><code>name<\/code> - String<\/li>\n<li><code>url<\/code> - String<\/li>\n<li><code>date<\/code> - String<\/li>\n<li><code>content<\/code> - String<\/li>\n<li><code>parent<\/code> - Integer<\/li>\n<li><code>author<\/code> - Object (only set if the comment author was registered &amp; logged in)<\/li>\n<\/ul>\n\n<h3>4.6. Attachment response object<\/h3>\n\n<ul>\n<li><code>id<\/code> - Integer<\/li>\n<li><code>url<\/code> - String<\/li>\n<li><code>slug<\/code> - String<\/li>\n<li><code>title<\/code> - String<\/li>\n<li><code>description<\/code> - String<\/li>\n<li><code>caption<\/code> - String<\/li>\n<li><code>parent<\/code> - Integer<\/li>\n<li><code>mime_type<\/code> - String<\/li>\n<li><code>images<\/code> - Object with values including <code>thumbnail<\/code>, <code>medium<\/code>, <code>large<\/code>, <code>full<\/code>, each of which are objects with values <code>url<\/code>, <code>width<\/code> and <code>height<\/code> (only set if the attachment is an image)<\/li>\n<\/ul>\n\n<!--section=installation-->\n<ol>\n<li>Upload the <code>ideapress-json-api<\/code> folder to the <code>\/wp-content\/plugins\/<\/code> directory or install directly through the plugin installer.<\/li>\n<li>Activate the plugin through the 'Plugins' menu in WordPress or by using the link provided by the plugin installer.<\/li>\n<\/ol>\n\n<!--section=faq-->\n<ol>\n<li>Why the plugin doesn't work?\nIt cannot work together with other json api plugin<\/li>\n<\/ol>\n\n<!--section=changelog-->\n<p>Initial checkin<\/p>","raw_excerpt":"Don&#039;t write a single line of code. Turn your wordpress into mobile app in 5 mins. (Android, iOS, winPhone)","jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/tah.wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin\/23566","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/tah.wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin"}],"about":[{"href":"https:\/\/tah.wordpress.org\/plugins\/wp-json\/wp\/v2\/types\/plugin"}],"replies":[{"embeddable":true,"href":"https:\/\/tah.wordpress.org\/plugins\/wp-json\/wp\/v2\/comments?post=23566"}],"author":[{"embeddable":true,"href":"https:\/\/tah.wordpress.org\/plugins\/wp-json\/wporg\/v1\/users\/michaelsiu"}],"wp:attachment":[{"href":"https:\/\/tah.wordpress.org\/plugins\/wp-json\/wp\/v2\/media?parent=23566"}],"wp:term":[{"taxonomy":"plugin_section","embeddable":true,"href":"https:\/\/tah.wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin_section?post=23566"},{"taxonomy":"plugin_tags","embeddable":true,"href":"https:\/\/tah.wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin_tags?post=23566"},{"taxonomy":"plugin_category","embeddable":true,"href":"https:\/\/tah.wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin_category?post=23566"},{"taxonomy":"plugin_contributors","embeddable":true,"href":"https:\/\/tah.wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin_contributors?post=23566"},{"taxonomy":"plugin_business_model","embeddable":true,"href":"https:\/\/tah.wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin_business_model?post=23566"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}