Git Product home page Git Product logo

thermal-api's Introduction

Please note: This plugin is no longer being actively maintained or supported.

Thermal API

Build Status

Current API version: v1

Overview

Thermal is the WordPress plugin that gives you the access and control to your content from outside of the WordPress admin. Thermal supports client-based decisions that, when combined with a responsive design framework, allows for a truly responsive application leveraging a WordPress content source.

Versions

In order to support migration, the API plugin will support up to 2 versions of the API. Once a version is more than 1 cycle old, it will no longer respond at it's API root unless configured to do so.

API Root

The URL root of the API will be the version number of the API prefixed by your WordPress site URL and the Voce\Thermal\API_ROOT constant. By default this is set to wp_api but can be overridden by setting it in wp-config.php.

The current API version is v1 so the default URL root is:

http://example.com/wp_api/v1/

Resource Types

The following resources are available

Posts

A post represents a single item of content.

Methods

List

Request
GET {api root}/posts
Parameters

Parameter Data Type Description
Date Filters
m string A compressed datetime string in the format of 'YmdGis' that represents date/time range to filter posts to (.e.g 2012-01-01 13:59:59 is expressed as 20120101135959). As most right most parts of the string are left off, the filter becomes less exact.

Examples:

  • 'm=2012' Only posts from 2012 will be returned; Equivalent to 'year=2012'
  • 'm=201206' Only posts from June 2012 will be returned; Equivalent to 'year=2012&monthnum=6'
  • 'm=20120609' Only posts from June 9th, 2012 will be returned; Equivalent to 'year=2012&monthnum=6&day=9'
year integer 4 digit year (e.g. 2012)
monthum integer Month number (from 1 to 12)
w integer Week of the year (from 0 to 53)
day integer Day of the month (from 0 to 31)
hour integer Hour of the day in 24 hour format (from 0 to 23)
minute integer Minute (from 0 to 59)
second integer Second (from 0 to 59)
before string A parsable formatted date string. Unless specified in the format used, the result will be relative to the timezone of the site.
after string A parsable formatted date string. Unless specified in the format used, the result will be relative to the timezone of the site.
Search Filtering
s string Search keyword or string, by default this searches against the title and post_content By default, the search expression is split into individual terms.
exact boolean Default false. If true, the search will omit the wildcard '%' wrapper, making it so that at least one searched fields be an exact match.
sentence boolean Default false. If true, the search string will not be split up into individual tokens and the expression will be matched in its entirety.
Taxonomy Filters
cat array|integer The term_id of the category to include. An array of IDs will also be accepted.
category_name string The slug of a single category.
tag string The slug of a single tag
taxonomy associative array An associative array where the key is the name of the taxonomy and the value is an array of term IDs. Post that exist in any of the terms will be included in the results. Only public taxonomies will be recognized.
Pagination Filters
paged integer A positive integer specifiying the page (or subset of results) to return. This filter will automatically determine the offset to use based on the per_page and paged. Using this filter will cause include_found to be true.
per_page integer The maximum number of posts to return. The value must range from 1 to MAX_POSTS_PER_PAGE.
offset integer The number of posts to skip over before returning the result set.
Ordering Parameters
orderby array|string Sort the results by the given identifier. Defaults to 'date'. Supported values are:
  • 'none' - No ordering will be applied.
  • 'ID' - The ID of the post.
  • 'author' - The value of the author ID.
  • 'title' - The title of the post.
  • 'name' - The slug/name of the post.
  • 'date' - (Default) Publish date of the post.
  • 'modified' - Last modified date of the post.
  • 'parent'- The ID of the post's parent
  • 'rand' - A random order, Note: due to caching, the order may not change on every request.
  • 'comment_count' - The number of comments the post has.
  • 'menu_order' - The set menu order for the post.
  • 'post__in' - Preserves the order supplied in the post__in filter. This is ignored unless the post__in filter is supplied.

Orderby will also accept an array of multiple identifiers.

order string The order direction. Options are 'ASC' and 'DESC'. Default is 'DESC'
General Filters
author_name string The user_nicename of the author.
author integer The ID of the authors to include. An array of IDs will also be accepted. Negative ID's can be used to denote exclusion.
post__in array|integer An array of post ID's to include.
p integer A single post ID
name string The post_name or slug of the post
pagename string The post_name or slug of the post. Will cause the post_type filter to default to 'page'
attachment string The post_name or slug of the post. Will cause the post_type filter to default to 'attachment'.
attachment_id integer Synonym to 'p' filter.
subpost string Synonym for 'attachment' filter.
subpost_id integer Synonym for 'attachment_id' filter.
post_type array|string The post types to be included in the result set.
post_status array|string Default to 'publish'. The post statii to include in the result set. Note that the statii passed in are run through capability checks for the current user.
post_parent__in array|integer Array or single Post ID to pull child posts from.
Response Altering Parameters
include_found boolean Defaut to false. When true, the response will include a found rows count. There is some overhead in generating the total count so this should only be turned on when needed. This is automatically turned on if the 'paged' filter is used.
callback string When set, the response will be wrapped in a JSONP callback.
Response
{
	'found': 40, //only provided if include_found == true
	"posts": [
		[Post Object],
		….
	]
}

Single Entity

Request
GET {api root}/posts/{id}
Parameters
Parameter Data Type Description
Response Altering Parameters
callback string When set, the response will be wrapped in a JSONP callback.
Post JSON Schema
{
    "title": "Post Object",
    "description": "A representation of a single post object",
    "type": "object",
    "id": "#post",
    "properties": {
        "author": {
            "description": "The user set as the author of the post.",
            "type": {
                "$ref": "#user"
            },
            "required": true
        },
        "comment_count": {
            "description": "The number of comments for this post.",
            "type": "integer",
            "minimum": 0,
            "required": true
        },
        "comment_status": {
            "description": "The current status determining whether the post is accepting comments.",
            "enum": ["open", "closed"],
            "required": true
        },
        "content_display": {
            "description": "The content of the post after it has been run through the set 'the_content' filters.  Shortcodes are not expanded.",
            "type": "string",
            "required": true
        },
        "content": {
            "description": "The raw content of the post as it's stored in the database.",
            "type": "string",
            "required": true
        },
        "date": {
            "description": "The post's creation time in iso 8601 format.",
            "type": "string",
            "format": "date-time",
            "required": true
        },
        "excerpt_display": {
            "description": "The excerpt of the post after it has been run through the 'the_excerpt' filters.",
            "type": "string",
            "required": true
        },
        "excerpt": {
            "description": "The raw excerpt as it is stored in the database.",
            "type": "string",
            "required": true
        },
        "id_str": {
            "description": "The ID of the post represented as a string.",
            "type": "string",
            "required": true
        },
        "id": {
            "description": "The ID of the post",
            "type": "integer",
            "minimum": 1,
            "required": true
        },
        "type": {
            "description": "The post_type of the post",
            "type": "string",
            "required": true
        },
        "media": {
            "type": "array",
            "required": false,
            "items": {
                "type": {
                    "$ref": "#mediaItem"
                }
            }
        },
        "meta": {
            "description": "Additional data for the Post object.  Handling must be provided by other plugins to expand the provided meta beyond core properties.",
            "type": "object",
            "required": false,
            "default": {},
            "additionalProperties": {
                "featuredImage": {
                    "description": "The ID of the image being referenced as the featured image.  The referenced image should be present in the media property.",
                    "type": "integer",
                    "minimum": 1
                },
                "gallery": {
                	"description": "An array of objects that represent the galleries in the post content.",
                	"type": "array",
                	"required": false,
                	"items": {
                	 	"ids": {
                	 		"description": "The IDs of the attachments to be used in the gallery.",
                	 		"type": "array",
                	 		"required": false
                	 	},
                    	"orderby": {
                    		"description": "Specifies how to sort the display thumbnails.",
                    		"type": "array",
                    		"required": false
                    	},
                    	"order": {
                    		"description": "Specifies the sort order used to display thumbnails."
                    		"type": "string",
                    		"required": false
                    	},
                    	"in": {
                    		"description": "An array of IDs to only show the images from these attachments."
                    		"type": "array",
                    		"required": false
                    	},
                    	"exclude": {
                    		"description": "An array of IDs to not show the images from these attachments."
                    		"type": "array",
                    		"required": false
                    	},
                    	"id": {
                	 		"description": "The ID of the post to be used in the gallery. Used for specifying other posts.",
                	 		"type": "integer",
                	 		"required": false
                	 	}
                	}
                }
            }
        },
        "mime_type": {
            "description": "The mime type of the represented object",
            "type": "string",
            "required": true,
            "default": "text/html"
        },
        "modified": {
            "type": "string",
            "format": "date-time",
            "required": true
        },
        "name": {
            "description": "The name (slug) for the post, used in URLs.",
            "type": "string",
            "required": true
        },
        "parent_str": {
            "description": "The ID of the post's parent as a string, if it has one.",
            "type": "string",
            "required": false
        },
        "parent": {
            "description": "The ID of the post's parent as a string, if it has one.",
            "type": "integer",
            "required": false
        },
        "permalink": {
            "description": "The full permalink URL to the post.",
            "type": "string",
            "formate": "uri",
            "required": true
        },
        "status": {
            "description": "The status of the post.",
            "type": {
                "enum": ["publish", "draft", "pending", "future", "trash"]
            },
            "required": true
        },
        "taxonomies": {
            "description": "Key/Value pairs of taxonomies that exist for the given post where the Key is the name of the taxonomy.",
            "type": "object",
            "required": false,
            "default": {},
            "additionalProperties": {
                "category": {
                    "type": "array",
                    "items": {
                        "type": {
                            "$ref": "#term"
                        }
                    },
                    "required": false
                },
                "post_tag": {
                    "type": "array",
                    "items": {
                        "type": {
                            "$ref": "#term"
                        }
                    },
                    "required": false
                }
            }
        },
        "title": {
            "description": "The title of the Post.",
            "type": "string",
            "required": true
        }
    }
}
Example Post Response
{
	"id" : 1234567,
	"id_str" : "1234567",
	"type" : "post",
	"permalink": "http://example.com/posts/foobar/",
	"parent": 12345,
	"parent_str": "12345",
	"date": "2012-01-01T12:59:59+00:00",
	"modified": "2012-01-01T12:59:59+00:00",
	"status": "publish",
	"comment_status":"open",
	"comment_count": 99,
	"menu_order": 99,
	"title": "Lorem Ipsum Dolor!",
	"name": "loerm-ipsum-dolor"	,
	"excerpt": "Lorem ipsum dolor sit amet, consectetur adipiscing elit. Donec sed lacus eros. Integer elementum urna.",
	"excerpt_display": "<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Donec sed lacus eros. Integer elementum urna.</p>",
	"content": "Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed nec consequatnibh. Quisque in consectetur ligula. Praesent pretium massa vitae neque adipiscing vita cursus nulla congue.\n<img src=\"http://example.com/wp-content/uploads/2012/03/foobar.jpg\" class=\"alignleft  size-medium wp-image-17115\" alt=\"Lorem ipsum doler set amut.\" />\n Cras aliquet ipsum non nisi accumsan tempor sollicitudin lacus interdum Donec in enim ut ligula dignissim tempor. Vivamus semper cursus mi, at molestie erat lobortiut. Pellentesque non mi vitae augue egestas vulputate et eu massa. Integer et sem orci. Suspendisse at augue in ipsum convallis semper.\n\n[gallery ids=\"1,2,3,4\"]\n\nNullam vitae libero eros, a fringilla erat. Suspendisse potenti. In dictum bibendum liberoquis facilisis risus malesuada ac. Nulla ullamcorper est ac lectus feugiat scelerisque.  Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas",
	"content_display": "<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed nec consequatnibh. Quisque in consectetur ligula. Praesent pretium massa vitae neque adipiscing vita cursus nulla congue.</p>\n<img src=\"http://example.com/wp-content/uploads/2012/03/foobar.jpg\" class=\"alignleft  size-medium wp-image-17115\" alt=\"Lorem ipsum doler set amut.\" />\n<p>Cras aliquet ipsum non nisi accumsan tempor sollicitudin lacus interdum Donec in enim ut ligula dignissim tempor. Vivamus semper cursus mi, at molestie erat lobortiut. Pellentesque non mi vitae augue egestas vulputate et eu massa. Integer et sem orci. Suspendisse at augue in ipsum convallis semper.</p>\n\n<div class=\"gallery\" id=\"gallery-1234\"></div>\n\n<p>Nullam vitae libero eros, a fringilla erat. Suspendisse potenti. In dictum bibendum liberoquis facilisis risus malesuada ac. Nulla ullamcorper est ac lectus feugiat scelerisque.  Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas</p>",
	"author": [User Object],
	"mime_type": "",
	"meta": {
		"featuredImage": 123456,
		"gallery" : [
			{
				"ids": [23],
				"orderby": [
					"menu_order",
					"ID"
				],
				"order": "ASC",
				….
			},
			….
		]
	},
	"taxonomies": {
		"category": [
			[Term Object],
			….
		],
		"post_tag": [
			[Term Object],
			….
		],
		….
	},
	"media": [
		{
			"type":
			"id": 123456,
			"id_str": ""123445",
			"altText": "Lorem ipsum doler set amut.",
			"mime_type": "image/jpg",
			"sizes": [
				{
					"name": "thumbnail",
					"width": 100,
					"height": 80,
					"url": "http://example.com/wp-content/uploads/2012/02/foobar-100x80.jpg"
				},
				….
			]
		},
		….
	]
}

##Users A User represents a single author or user on the site.

Methods

List

Request
GET {api root}/users
Parameters
Parameter Data Type Description
Pagination Filters
paged integer A positive integer specifiying the page (or subset of results) to return. This filter will automatically determine the offset to use based on the per_page and paged. Using this filter will cause include_found to be true.
per_page integer The maximum number of posts to return. The value must range from 1 to MAX_USERS_PER_PAGE.
offset integer The number of posts to skip over before returning the result set.
Ordering Parameters
orderby string Sort the results by the given identifier. Defaults to 'display_name'. Supported values are:
  • 'display_name' - Ordered by the display name of the user.
  • 'nicename' - The slug/nicename of the user.
  • 'post_count' - The number of posts the user has.
order string The order direction. Options are 'ASC' and 'DESC'. Default is 'DESC'
General Filters
in array|integer An array of user ID's to include.
Response Altering Parameters
include_found boolean Defaut to false. When true, the response will include a found rows count. There is some overhead in generating the total count so this should only be turned on when needed. This is automatically turned on if the 'paged' filter is used.
who string Filters to users based on a subset of roles. Currently, only 'authors' is supported.
callback string When set, the response will be wrapped in a JSONP callback.
Response
{
	'found': 40, //only provided if include_found == true
	"users": [
		[User Object],
		….
	]
}

Single Entity

Request
GET {api root}/users/{id}
Parameters
Parameter Data Type Description
Response Altering Parameters
callback string When set, the response will be wrapped in a JSONP callback.
User JSON Schema
{
    "description": "Representation of a single sytem user or author.",
    "id": "#user",
    "type": "object",
    "properties": {
        "id_str": {
            "description": "The ID of the User object as a string.",
            "type": "integer",
            "required": true
        },
        "id": {
            "description": "The ID of the User object.",
            "type": "integer",
            "required": true
        },
        "nicename": {
            "description": "The user's slug, or url safe name.",
            "type": "string",
            "required": false
        },
        "display_name": {
            "description": "The user's name as shown publicly.",
            "type": "string",
            "required": false
        },
        "posts_url": {
            "description": "The URL to the user's posts.",
            "type": "string",
            "format": "uri",
            "required": false
        },
        "user_url": {
            "description": "The User's personal URL.",
            "type": "string",
            "required": false
        },
        "avatar": {
            "description": "An array of images/sizes available for the User's avatar.",
            "type": "array",
            "items": {
                "description": "Image information for a User's Avatar.",
                "type": "object",
                "properties": {
                    "height": {
                        "description": "Height of the image in pixels.",
                        "type": "integer",
                        "required": true
                    },
                    "url": {
                        "description": "Full URL to the image resource.",
                        "type": "string",
                        "format": "uri",
                        "required": true
                    },
                    "width": {
                        "description": "Width of the image in pixels.",
                        "type": "integer",
                        "required": true
                    }
                }
            }
        },
        "meta": {
            "description": "Extended User data.",
            "type": "object"
        }
    }

}
Example User Response
{
	"id" : 1234567,
	"id_str" : "1234567",
	"nicename": "john-doe",
	"display_name":"John Doe",
	"posts_url": "http://example.com/author/john-doe/",
	"user_url": "http://vocecomm.com",
	"avatar": [
		{
			"url":"http://1.gravatar.com/avatar/7a10459e7210f3bbaf2a75351255d9a3?s=64",
			"width":64,
			"height":64
		},
		….
	],
	"meta":{
		"nickname": "Johnny",
		"first_name": "John",
		"last_name": "Doe",
		"description": "Lorem ipsum dolar set amet."
	}
}

##Taxonomies Taxonomies represent the different types of classifications of content. Only public taxonomies can be returned via the API.

Methods

List

Request
GET {api root}/taxonomies
Parameters
Parameter Data Type Description
in array|string An array of taxonomy names to include.
post_type array|string An array of post_types to include taxonomies from. Results will include any taxonomies with at least 1 of the given post_types included.
callback string When set, the response will be wrapped in a JSONP callback.
callback string When set, the response will be wrapped in a JSONP callback.
Response
{
	"taxonomies": [
		[Taxonomy Object]
		….
	]
}

Single Entity

Request
GET {api root}/taxonomies/{name}
Parameters
Parameter Data Type Description
Response Altering Parameters
callback string When set, the response will be wrapped in a JSONP callback.
Taxonomy JSON Schema
{
    "id": "#taxonomy",
    "descrption": "A representation of a taxonomy.",
    "type": "object",
    "properties": {
        "name": {
            "description": "The name/unique identifier for the taxonomy.",
            "type": "string",
            "required": true
        },
        "post_type": {
            "description": "An array of post types the taxony is tied to.",
            "type": "array",
            "items": {
                "description": "The post_type string.",
                "type": "string"
            }
        },
        "hierarchical": {
            "description": "Indicates whether the taxonomy is hierarchical or allows parent/child relationships.",
            "type": "boolean",
            "default": false
        },
        "query_var": {
            "description": "The query_var tied to this taxonomy.  Useful when processing rewrite rules to determine the proper API query.",
            "type": "string",
            "required": false
        },
        "labels": {
            "description": "The user displayed name representing the taxonomy.",
            "type": "object",
            "properties": {
                "name": {
                    "description": "The plural name of the taxonomy.",
                    "type": "string"
                },
                "singularName": {
                    "description": "The singular name of the taxonomy.",
                    "type": "string"
                }
            }
        },
        "meta": {
            "description": "Extended Taxonomy data.",
            "type": "object"
        }
    }
}
Example Taxonomy Response
{
	"name": "category",
	"post_types": [
		"post",
		"attachment",
		….
	],
	"hierarchical": true,
	"queryVar":"category",
	"labels": {
		"name": "Categories",
		"singularName": "Category"
	},
	"meta":{
	}
}

##Terms Terms are individual classifications within a taxonomy.

Methods

List

Request
GET {api root}/taxonomies/{name}/terms
Parameters
Parameter Data Type Description
Pagination Filters
paged integer A positive integer specifiying the page (or subset of results) to return. This filter will automatically determine the offset to use based on the per_page and paged. Using this filter will cause include_found to be true.
per_page integer The maximum number of posts to return. The value must range from 1 to MAX_TERMS_PER_PAGE.
offset integer The number of posts to skip over before returning the result set.
Ordering Parameters
orderby string Sort the results by the given identifier. Defaults to 'name'. Supported values are:
  • 'name' - The user readable name of the term.
  • 'slug' - The slug of the term.
  • 'count' - The number of posts the term is connected to.
order string The order direction. Options are 'ASC' and 'DESC'. Default is 'DESC'
General Filters
in array|integer An array of term ID's to include.
slug string A term slug to include.
parent id Include the children of the provided term ID.
hide_empty boolean If true, only terms with attached posts will be returned. Default is true.
pad_counts boolean If true, count all of the children along with the term. Default is false.
Response Altering Parameters
include_found boolean Defaut to false. When true, the response will include a found rows count. There is some overhead in generating the total count so this should only be turned on when needed. This is automatically turned on if the 'paged' filter is used.
callback string When set, the response will be wrapped in a JSONP callback.
Response
{
	"found": 25,  //only provided if include_found == true
	"terms": [
		[Term Object]
		….
	]
}

Single Entity

Request
GET {api root}/taxonomies/{name}/terms/{term_id}
Parameters
Parameter Data Type Description
Response Altering Parameters
callback string When set, the response will be wrapped in a JSONP callback.

Term JSON Schema

{
    "type": "object",
    "required": false,
    "properties": {
        "description": {
            "description": "A long text describing the term.",
            "type": "string",
            "required": false
        },
        "meta": {
            "description": "Extended Term data.",
            "type": "object",
        },
        "name": {
            "description": "The title/name of the term as displayed to users.",
            "type": "string",
            "required": false
        },
        "parent_str": {
            "description": "The ID of the parent term as a string, if exists.",
            "type": "string",
            "required": false
        },
        "parent": {
            "description": "The ID of the parent term, if exists.",
            "type": "number",
            "required": false
        },
        "post_count": {
            "description": "The distinct count of posts attached to this term.  If 'pad_count' is set to true, this will also include all posts attached to child terms.  This only includes posts of type 'post'.",
            "type": "number",
            "required": false
        },
        "slug": {
            "description": "The name (slug) of the term as used in URLs.",
            "type": "string",
            "required": false
        },
        "taxonomy": {
            "type": "string",
            "required": false
        },
        "id_str": {
            "description": "The ID of the term as a string.",
            "type": "string",
            "id": "http://jsonschema.net/term_id_str",
            "required": false
        },
        "id": {
            "description": "The ID of the term.",
            "type": "number",
            "id": "http://jsonschema.net/term_id",
            "required": false
        },
        "term_taxonomy_id_str": {
            "description": "The ID that uniquely represents this term/taxonomy as ing asterms are shared across multiple taxonomies.",
            "type": "string",
            "id": "http://jsonschema.net/term_taxonomy_id_str",
            "required": false
        },
        "term_taxonomy_id": {
            "description": "The ID that uniquely represents this term/taxonomy as terms are shared across multiple taxonomies.",
            "type": "number",
            "id": "http://jsonschema.net/term_taxonomy_id",
            "required": false
        }
    }
}
Example Term Response
{
	"id": 123456,
	"term_id_str": "123456",
	"term_taxonomy_id": 123456789,
	"term_taxonomy_id_str": "123456789",
	"parent": 1234567,
	"parent_str": "1234567",
	"name": "Local News",
	"slug": "local-news",
	"taxonomy": "category",
	"description": "News reports from around Polk County",
	"post_count": 25,
	"meta":{
	}
}

##Rewrite Rules Rewrite Rules can be used to convert internal links in content into API requests.

Methods

List

Request
GET {api root}/rewrite_rules

Rewrite Rules JSON Schema

{
    "id": "#rewrite_rules",
    "description": "Rewrite Rules represent the URL structure on the hosting API site.  Providing these to the client, allows the client to override internal links with sequential API requests.",
    "type": "object",
    "properties": {
        "base_url": {
            "description": "The root URL which all rewrite rules are based.",
            "type": "string",
            "format": "uri",
            "required": true
        },
        "rewrite_rules": {
            "type": "array",
            "items": {
                "type": "object",
                "properties": {
                    "query_expression": {
                        "description": "The format string used to build the resulting query parameters for the rewrite rules from the components matched from the regex.",
                        "type": "string",
                        "required": true
                    },
                    "regex": {
                        "description": "The regular expression used to break down the requested URL into components.",
                        "type": "string",
                        "format": "regex",
                        "required": true
                    }
                }
            }


        }
    }
}
Example Rewrite Rules Response
{
	"base_url": "http://example.com/",
	"rewrite_rules": [
		{
			"regex": "category/(.+?)/?$",
			"query_expression": "category_name=$1"
		}
		….
	]
}

Media Items

Below are the schemas for media items.

Base Media Items JSON Schema

{
    "description": "Base media object",
    "id": "mediaItem",
    "type": "object",
    "properties": {
        "type": {
            "description": "The subclass of media object being represented.",
            "type": "string",
            "required": true
        }
    }

}

Internal Media Item Base JSON Schema

{
    "description": "An internal media item hosted by this WP instance that is backed by a Post Object",
    "type": "object",
    "id": "#internalMediaItem",
    "extends": {
        "$ref": "#mediaItem"
    },
    "properties": {
        "idStr": {
            "description": "The ID of the Post object representing this media attachment as a string.",
            "type": "integer",
            "required": true
        },
        "id": {
            "description": "The ID of the Post object representing this media attachment.",
            "type": "integer",
            "required": true
        },
        "mimeType": {
            "description": "The mime type of the attched media object",
            "type": "string",
            "required": true
        },
    }
}

Internal Image Media Item JSON Schema

{
    "description": "An internal image item hosted by this WP instance",
    "type": "object",
    "id": "#internalMediaItem",
    "extends": {
        "$ref": "#mediaItem"
    },
    "properties": {
        "altText": {
            "description": "The alternate text for the image.  Maps to post_meta key '_wp_attachment_image_alt'.",
            "type": "string",
            "required": false
        },
        "sizes": {
            "description": "Listing of available sizes of the image allowing the proper size to be used for the client device.",
            "type": "array",
            "required": true,
            "items": {
                "type": "object",
                "required": true,
                "properties": {
                    "height": {
                        "description": "Height of the image in pixels.",
                        "type": "integer",
                        "required": true
                    },
                    "name": {
                        "description": "The identifier for the size that generated this size of the image.",
                        "type": "string",
                        "required": true
                    },
                    "url": {
                        "description": "Full URL to the image resource.",
                        "type": "string",
                        "format": "uri",
                        "required": true
                    },
                    "width": {
                        "description": "Width of the image in pixels.",
                        "type": "integer",
                        "required": true
                    }
                }
            }


        }
    }
}

Comments

A comment represents a user response to a post

Methods

List

Request
GET {api root}/comments

GET {api root}/posts/{#post_id}/comments
Parameters

Parameter Data Type Description
Date Filters
before string A parsable formatted date string. Unless specified in the format used, the result will be relative to the timezone of the site.
after string A parsable formatted date string. Unless specified in the format used, the result will be relative to the timezone of the site.
Search Filtering
s string Search keyword or string, by default this searches against the author, author email, author url, author ip, and content. The search looks for a match to the entire search expression.
Pagination Filters
paged integer A positive integer specifiying the page (or subset of results) to return. This filter will automatically determine the offset to use based on the per_page and paged arguments. Using this filter will cause include_found to be true.
per_page integer The maximum number of posts to return. The value must range from 1 to MAX_COMMENTS_PER_PAGE.
offset integer The number of posts to skip over before returning the result set.
Ordering Parameters
orderby array|string Sort the results by the given identifier. Defaults to 'date'. Supported values are:
  • 'comment_date_gmt' - (Default) The GMT date of the post.
  • 'comment_ID' - The ID of the post.
  • 'comment_author' - The value of the author ID.
  • 'comment_date' - The date of the comment..
  • 'comment_type' - The type of comment.
  • 'comment parent'- The ID of the comment's parent
  • 'comment_post_ID' - The ID of the post which the comment belongs.
  • 'user_id' - The ID of the user making the comments.

Orderby will also accept an array of multiple identifiers.

order string The order direction. Options are 'ASC' and 'DESC'. Default is 'DESC'
General Filters
in integer|array Array of Ids of comments to include.
parent integer ID of the parent comment to pull from.
post_id integer ID of post from which to pull comments.
post_name string Slug/Name of the post from which to pull comments.
type string The type of comments to return. Default options: 'comment', 'pingback', 'trackback', 'pings' (returns trackbacks and pingbacks').
status string The status of comments to return. Default: 'approved'.
user_id int User ID of commentor making the comments.
Response Altering Parameters
include_found boolean Defaut to false. When true, the response will include a found rows count. There is some overhead in generating the total count so this should only be turned on when needed. This is automatically turned on if the 'paged' filter is used.
callback string When set, the response will be wrapped in a JSONP callback.
Response
{
	'found': 40, //only provided if include_found == true
	"comments": [
		[Comment Object],
		….
	]
}

Single Entity

Request
GET {api root}/comments/{id}
Parameters
Parameter Data Type Description
Response Altering Parameters
callback string When set, the response will be wrapped in a JSONP callback.
Comment JSON Schema
{
    "title": "Comment Object",
    "description": "A representation of a single post object",
    "type": "object",
    "id": "#comment",
    "properties": {
        "author": {
            "description": "Display name of the author of the comment.",
            "type": "string",
            "required": true
        }
        "author_url": {
            "description": "URL set for the author of the comment.",
            "type": "string",
            "required": false
        }
        "date": {
            "description": "The comment's creation time in iso 8601 format.",
            "type": "string",
            "format": "date-time",
            "required": true
        },
        "content": {
            "description": "The raw comment content.",
            "type": "string",
            "required": true
        },
        "content_display": {
            "description": "Display formatted content of the comment.",
            "type": "string",
            "required": true
        },
        "user": {
            "description": "ID of the user making the comment",
            "type": "integer",
            "required": false
        },
					"user_id_str": {
            "description": "String version of the ID of the user making the comment",
            "type": "string",
            "required": false
        },
        "id_str": {
            "description": "The ID of the post represented as a string.",
            "type": "string",
            "required": true
        },
        "id": {
            "description": "The ID of the post",
            "type": "integer",
            "minimum": 1,
            "required": true
        },
        "type": {
            "description": "The type of comment.  Deafult enum: 'comment', 'pingback', 'trackback'",
            "type": "string",
            "required": true
        },
        "media": {
            "type": "array",
            "required": false,
            "items": {
                "type": {
                    "$ref": "#mediaItem"
                }
            }
        },
        "parent_str": {
            "description": "The ID of the comment's parent as a string, if it has one.",
            "type": "string",
            "required": false
        },
        "parent": {
            "description": "The ID of the comment's parent as a string, if it has one.",
            "type": "integer",
            "required": false
        },
        "status": {
            "description": "The status of the comment.",
            "type": {
                "enum": ["approve", "pending", "spam", "trash"]
            },
            "required": true
        }
    }
}
Example Comment Response
{
    "id": 597,
    "id_str": "597",
    "type": "comment",
    "author": "John Doe",
    "author_url": "http://example.org",
    "parent": 0,
    "parent_str": "0",
    "date": "2013-06-11T18:39:46+00:00",
    "content": "This is my comment text",
    "status": "approve",
    "user": 1,
    "user_id_str": "1",
    "content_display": "<p>This is my comment text<\/p>\n",
    "avatar": [
        {
            "url": "http:\/\/1.gravatar.com\/avatar\/96614ec98aa0c0d2ee75796dced6df54?s=96&amp;d=http%3A%2F%2F1.gravatar.com%2Favatar%2Fad516503a11cd5ca435acc9bb6523536%3Fs%3D96&amp;r=G",
            "width": 96,
            "height": 96
        }
    ]
}

thermal-api's People

Contributors

alexsancho avatar banderon avatar brock avatar chrisscott avatar jeffstieler avatar johnciacia avatar kevinlangleyjr avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

thermal-api's Issues

excerpt field is not populated

the excerpt key/value pair is always empty while the excerpt_display does its job correctly. Any clue how to enable the excerpt key/value pair. The advantage of this is that there is no html formatting done in the JSON response.

Be more generous on API_BASE format

Had a user leave out the trailing slash which means the routes will fail. I think we should try to leading slash (and strip trailing if required) API_BASE if it isn't already when we grab the constant.

Activation error

Upon attempting to activate the plugin on Wordpress 3.5.1 with PHP 5.3.13, I receive the following error: Fatal error: Class 'API_Dispatcher' not found in C:\wamp\www\wordpress\wp-content\plugins\thermal-api\thermal-api.php on line 24

Installation not working

Hello,
This plugin is potentially very very interesting as I can pull in data into my AngularJS application
I am working with Wordpress v3.7.1 and installed Thermal API with the normal plugin tool of WP. I did virtually no customisation to the installed WordPress so far, hence it is pretty much "out-of-the-box":

Then per some documentation and google search info, I tried

localhost:8888/wordpress/wp_api/v1/posts/

I get a 404 error

"The requested URL /WordPress/api/v1.0/posts was not found on this server."

I also tried v0.7.7 as this is the version deployed right now.
I would have expected some more detailed error message.

Can somebody help
Thanks

Error after install

I tried this plugin and installed it on WP 3.4.1 and get error:

/wp_api/v1/posts

Slim Application Error
The application could not run because of the following error:

Details

Type: ErrorException
Code: 4096
Message: Argument 1 passed to Voce\Thermal\v1\PostsController::_get_post_galleries() must be an instance of WP_Post, instance of stdClass given, called in /domain.com/public_html/wp-content/plugins/thermal-api/api/v1/controllers/Posts.php on line 380 and defined
File: /domain.com/public_html/wp-content/plugins/thermal-api/api/v1/controllers/Posts.php
Line: 295

Slim down /posts response?

Should taxonomies, media, and author contain full objects by default?

These REALLY inflate the response objects.

I think we should discuss ways to allow API consumers to conditionally include these heavy objects, and maybe just get ids / names instead.

Custom Post Types [solved]

How would I make an API call to return results from a custom post type

wp_api/v1/posts?post_type=xxxx

Need help filtering posts data

hey I am a newbie. I need to list posts by categories, and also to view posts by id in json. I have installed thermal api plugin and I like it because it supports taxonomies. Now the categories I am using are in taxonomy.
When I use http://example.com/wp_api/v1/posts it gives me all posts. How do I filter the posts to view posts from a single category. Your help will be greatly appreciated.

List Scheduled Posts

I need the ability to view scheduled posts via the api.

I can use the plugin to activate this in your api, via 'The future is here' however this puts scheduled posts also on the blog. I only want scheduled posts to be on the api (aka for caching purposes in a mobile app)

How can I do this with Thermal API?

whoops

Parse error: syntax error, 
unexpected T_STRING in /{ROOTPATH}/wp-content/plugins/thermal-api/thermal-api.php on line 25

Standardise User output

I have noticed extremely large differences between the result for one user and the result for many.

Both are also missing many fields, i.e. my authors have an about field which should be in the result.

However, getting back to the point, here is the result for one user without query for ID:

{
    "data":{
        "ID":"7",
        "user_login":"lalalala",
        "user_pass":"$P$xxxxxx",
        "user_nicename":"lalalala",
        "user_email":"[email protected]",
        "user_url":"http:\/\/www.x.x",
        "user_registered":"2006-01-07 09:09:01",
        "user_activation_key":"",
        "user_status":"0",
        "display_name":"Cheese"
    },
    "ID":7,
    "caps":{
        "author":"1"
    },
    "cap_key":"wp_capabilities",
    "roles":[
        "author"
    ],
    "allcaps":{
        "upload_files":true,
        "edit_posts":true,
        "edit_published_posts":true,
        "publish_posts":true,
        "read":true,
        "level_2":true,
        "level_1":true,
        "level_0":true,
        "delete_posts":true,
        "delete_published_posts":true,
        "author":"1"
    },
    "filter":null
},

And here is the result for one user, querying on ID:

{
    "id":9,
    "id_str":"9",
    "nicename":"lalala",
    "display_name":"lalala",
    "user_url":"http:\/\/www.x.x\/x\/x.html",
    "posts_url":"http:\/\/www.x.x\/x\/x\/x\/x\/",
    "avatar":[
        {
            "url":"xxx",
            "width":96,
            "height":96
        }
    ],
    "meta":{
    }
}

As you can see the two are quite different and there are fields that exist in each but not both and there are also a lot of fields missing from both that should come back with the user.

create an entry

Is there any way to post some data to WP to create a new entry as a post, page or whatever custom post type?

Posts with attached media no longer return with getJSON

I just upgraded to Thermal 0.7.0 from 0.6.1 and when I request posts with JQuery's getJSON and there are any posts to be returned that have media attached, I get an empty response. Installing 0.6.1 again fixes the issue, so this appears to be a regression.

get pages instead of posts

hi, i read the docs and could not find a hint to parse content of pages,
is this not included? my whole architecture so far is based on sub/pages under parentpages, i use posts only for blogging. i am a bit lazy to move the whole architecture into a post system with subcategories instead of pages so i am asking: is it possible and if not is it planned to be implementet?

"per_page" pagination filter not working

In 0.7.1, when GETing "posts" using the "per_page" pagination filter, I receive a server error. It appears that there is an issue calling the constant MAX_POSTS_PER_PAGE as defined in API.php from Posts.php. Looks like the namespace is incorrect.

I have tried everything and I still can't get the basic url to work

I'm talking about just issuing a CURL or even in the browser, this will not work. I have made sure permalinks are set to postname and refreshed them. I have reinstalled the plugin several times and deactivated anything else that looked like it might conflict.

curl --request GET 'http://67.XXX.XXX.XX/dirsitename/wp-api/v1/' (varients therein so I could test posts, etc)

Is it because I'm using an IP for some reason. I'm stuck with the IP, I'm afraid. I keep getting a 404 no matter what I do (CURL or browser). Do I have to do it through your backbone example?

Allow getting post via permalink

One suggestion; if I want to keep my SEO friendly URLs I may find it hard to integrate the id into my URLs, instead what would be good is to get a permalink like:

/title-information/dragonflight-an-interview-with-author-marianne-taylor/

And use that to get a post.

Support for post revisions?

Is there support for revisions at all? I.e. list post revisions, switch between revisions, etc. I don't see any mention about revisions at all so I assume there is no support yet.

If this is really true, I might be able to help since I need it for my project anyway. I just need to confirm that it's really not there and no one is working on that at the moment.

Fatal error: Class 'Slim\Slim' not found

I've just updated to 0.10 but I'm getting this error:
Fatal error: Class 'Slim\Slim' not found in /app/config/public/wp-content/plugins/thermal-api/dispatcher.php on line 53

Clarify API version

In the docs, it isn't clear what the current version of the API is versus the plugin version and what the API base URL is.

I finally got a response from my posts curl, but it makes no sense. How do form queries to return json?

This is what I get when I run:

curl --request GET 'http://64.xxx.xxx.xx/sitenamedir/wp_api/v1/posts/'

#1 [internal function]: filter_events(Array)
#2 /var/www/html/sitenamedir/wp-includes/plugin.php(173): call_user_func_array('filter_events', Array)
#3 /var/www/html/sitenamedir/wp-content/plugins/events-manager/classes/em-events.php(170): apply_filters('em_events_outpu...', Array)
#4 /var/www/html/sitenamedir/wp-content/plugins/events-manager/classes/em-location.php(901): EM_Events->output(Array)
#5 /var/www/html/sitenamedir/wp-content/plugins/events-manager/classes/em-location.php(666): EM_Location->output('<div> #_LOCATIO...', 'html')
#6 /var/www/html/sitenamedir/wp-content/plugins/events-manager/templates/templates/location-single.php(16): EM_Location->output_single()
#7 /var/www/html/sitenamedir/wp-content/plugins/events-manager/events-manager.php(644): include('/var/www/html/i...')
#8 /var/www/html/sitenamedir/wp-content/plugins/events-manager/classes/em-location-post.php(76): em_locate_template('templates/locat...', true)
#9 [internal function]: EM_Location_Post::the_content('<p>Sundance Kab...')
#10 /var/www/html/sitenamedir/wp-includes/plugin.php(173): call_user_func_array(Array, Array)
#11 /var/www/html/sitenamedir/wp-content/plugins/thermal-api/api/v1/controllers/Posts.php(341): apply_filters('the_content', 'Sundance Kabuki...')
#12 [internal function]: Voce\Thermal\v1\Controllers\Posts::format(Object(WP_Post), 2, 'read')
#13 /var/www/html/sitenamedir/wp-content/plugins/thermal-api/api/v1/controllers/Posts.php(35): array_walk(Array, Array, 'read')
#14 [internal function]: Voce\Thermal\v1\Controllers\Posts::find(Object(Slim\Slim))
#15 /var/www/html/sitenamedir/wp-content/plugins/thermal-api/api/API_Base.php(87): call_user_func_array(Array, Array)
#16 [internal function]: Voce\Thermal\{closure}()
#17 /var/www/html/sitenamedir/wp-content/plugins/thermal-api/vendor/slim/slim/Slim/Router.php(172): call_user_func_array(Object(Closure), Array)
#18 /var/www/html/sitenamedir/wp-content/plugins/thermal-api/vendor/slim/slim/Slim/Slim.php(1222): Slim\Router->dispatch(Object(Slim\Route))
#19 /var/www/html/sitenamedir/wp-content/plugins/thermal-api/vendor/slim/slim/Slim/Middleware/Flash.php(86): Slim\Slim->call()
#20 /var/www/html/sitenamedir/wp-content/plugins/thermal-api/vendor/slim/slim/Slim/Middleware/MethodOverride.php(94): Slim\Middleware\Flash->call()
#21 /var/www/html/sitenamedir/wp-content/plugins/thermal-api/vendor/slim/slim/Slim/Middleware/PrettyExceptions.php(67): Slim\Middleware\MethodOverride->call()
#22 /var/www/html/sitenamedir/wp-content/plugins/thermal-api/vendor/slim/slim/Slim/Slim.php(1174): Slim\Middleware\PrettyExceptions->call()
#23 /var/www/html/sitenamedir/wp-content/plugins/thermal-api/dispatcher.php(57): Slim\Slim->run()
#24 [internal function]: Voce\Thermal\API_Dispatcher->dispatch_api('')
#25 /var/www/html/sitenamedir/wp-includes/plugin.php(406): call_user_func_array(Array, Array)
#26 /var/www/html/sitenamedir/wp-settings.php(327): do_action('wp_loaded')
#27 /var/www/html/sitenamedir/wp-config.php(111): require_once('/var/www/html/i...')
#28 /var/www/html/sitenamedir/wp-load.php(29): require_once('/var/www/html/i...')
#29 /var/www/html/sitenamedir/wp-blog-header.php(12): require_once('/var/www/html/i...')
#30 /var/www/html/sitenamedir/index.php(17): require('/var/www/html/i...')

How do I use the above? Is this correct? I spent the day reading the documentation (again) and trying other queries, but with very mixed results (usually running into "route" errors).

I was under the impression that by using this plugin, I could expect json results in return. The json results would vary in scope based on filtering or parameters the Thermal-API allows me to pass. Yet, I can't seem to find any "clear as day" examples in the docs.

Anyway, is the above what I should be seeing? Thanks much!

Media objects' sizes are "null"

I have a fairly vanilla Wordpress (v3.8.1) installation, and a theme that is blank. When attaching media to posts, the media array shows null for the sizes json key. For example:

{
    "posts": [
        {
            "type": "page",
            "parent": 0,
            "parent_str": "0",
            "date": "2014-02-28T01:16:17+00:00",
            "status": "publish",
            "comment_status": "open",
            "menu_order": 0,
            "title": "test page",
            "name": "test-page",
            "excerpt": "",
            "content": "test<a href=\"http://north.dev:8080/wp-content/uploads/2014/02/Screenshot-2014-02-27-16.37.50.png\"><img class=\"alignnone size-full wp-image-19\" alt=\"Screenshot 2014-02-27 16.37.50\" src=\"http://north.dev:8080/wp-content/uploads/2014/02/Screenshot-2014-02-27-16.37.50.png\" width=\"1768\" height=\"1104\" /></a>",
            "author": {
                "id": 1,
                "id_str": "1",
                "nicename": "nwittstock",
                "display_name": "nwittstock",
                "user_url": "",
                "posts_url": "http://north.dev:8080/author/nwittstock/",
                "avatar": [
                    {
                        "url": "http://0.gravatar.com/avatar/6b4e6185764e0ae549d3318a799667ef?s=96&amp;d=http%3A%2F%2F0.gravatar.com%2Favatar%2Fad516503a11cd5ca435acc9bb6523536%3Fs%3D96&amp;r=G",
                        "width": 96,
                        "height": 96
                    }
                ],
                "meta": {
                    "description": "",
                    "first_name": "",
                    "last_name": "",
                    "nickname": "nwittstock"
                }
            },
            "id": 21,
            "id_str": "21",
            "permalink": "http://north.dev:8080/test-page/",
            "modified": "2014-02-28T01:16:17+00:00",
            "comment_count": 0,
            "excerpt_display": "<p>test</p>\n",
            "content_display": "<p>test<a href=\"http://north.dev:8080/wp-content/uploads/2014/02/Screenshot-2014-02-27-16.37.50.png\"><img class=\"alignnone size-full wp-image-19\" alt=\"Screenshot 2014-02-27 16.37.50\" src=\"http://north.dev:8080/wp-content/uploads/2014/02/Screenshot-2014-02-27-16.37.50.png\" width=\"1768\" height=\"1104\" /></a></p>\n",
            "mime_type": "",
            "meta": {},
            "taxonomies": {},
            "media": [
                {
                    "id": 19,
                    "id_str": "19",
                    "mime_type": "image/png",
                    "alt_text": "alternate text",
                    "sizes": null
                }
            ]
        }
    ]
}

The file was newly uploaded using Wordpress's uploader, and it happens with any test image I try. The other plugins I have installed:

  • Advanced Custom Fields
  • Simple Page Ordering

Let me know if there's other useful information I can provide. I do not get any error messages that I've seen.

Thanks!

questions

how can i parse a page with its comments in it?
RESOLVED 👍 how can i get a similar behaviour like "post_parent"= "nameOfPost"

Posts/post responses don't include media data

This could be related to WordPress 3.6, I'm trying out 0.7.4 and only seeing the following for featured images:

"meta": {
    "featured_image": 13
}

The media array is empty however. It's also empty if I insert anything into the post itself. Is this related to #39?

Unfortunately I don't have access to a WordPress 3.5.x install anymore to verify if this is limited to 3.6.

404 error when attempting to reach API

I've got Wordpress 3.5.1 running on my localhost with PHP 5.3.13 and Thermal-API v0.6.1. I haven't made any modifications, so it's all stock. When I visit http://localhost/wp_api/v1/posts I receive a 404 error. This goes for any URL under http://localhost/wp_api/*.

Any suggestions?

Here's the dump of my $_SERVER

array (size=30)
'HTTP_HOST' => string 'localhost' (length=9)
'HTTP_USER_AGENT' => string 'Mozilla/5.0 (Windows NT 6.1; WOW64; rv:21.0) Gecko/20100101 Firefox/21.0' (length=72)
'HTTP_ACCEPT' => string 'text/html,application/xhtml+xml,application/xml;q=0.9,/;q=0.8' (length=63)
'HTTP_ACCEPT_LANGUAGE' => string 'en-US,en;q=0.5' (length=14)
'HTTP_ACCEPT_ENCODING' => string 'gzip, deflate' (length=13)
'HTTP_COOKIE' => string 'GUEST_LANGUAGE_ID=en_US; COOKIE_SUPPORT=true; JSESSIONID=B6D4CE4FABD361A9AEB8B3460493352E; wordpress_test_cookie=WP+Cookie+check; wordpress_logged_in_86a9106ae65537651a8e456835b316ab=admin%7C1370211335%7Cb94b603e28e725a6d36e5b647a8aa79a; wp-settings-time-1=1370038535' (length=267)
'HTTP_CONNECTION' => string 'keep-alive' (length=10)
'PATH' => string 'C:\Oracle\11.2.0\client_1;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0;C:\Program Files\SlikSvn\bin;C:\Program Files\Java\jdk1.6.0_22\bin;c:\Program Files (x86)\IBM\Client Access\Emulator;c:\Program Files (x86)\IBM\Client Access\Shared;c:\Program Files (x86)\IBM\Client Access;c:\ant\bin;c:\gradle-1.1\bin;c:\play-2.0.2;C:\Program Files (x86)\scala\bin;' (length=413)
'SystemRoot' => string 'C:\Windows' (length=10)
'COMSPEC' => string 'C:\Windows\system32\cmd.exe' (length=27)
'PATHEXT' => string '.COM;.EXE;.BAT;.CMD;.VBS;.VBE;.JS;.JSE;.WSF;.WSH;.MSC' (length=53)
'WINDIR' => string 'C:\Windows' (length=10)
'SERVER_SIGNATURE' => string '' (length=0)
'SERVER_SOFTWARE' => string 'Apache/2.2.22 (Win64) PHP/5.3.13' (length=32)
'SERVER_NAME' => string 'localhost' (length=9)
'SERVER_ADDR' => string '127.0.0.1' (length=9)
'SERVER_PORT' => string '80' (length=2)
'REMOTE_ADDR' => string '127.0.0.1' (length=9)
'DOCUMENT_ROOT' => string 'C:/wamp/www/' (length=12)
'SERVER_ADMIN' => string 'admin@localhost' (length=15)
'SCRIPT_FILENAME' => string 'C:/wamp/www/index.php' (length=21)
'REMOTE_PORT' => string '58656' (length=5)
'GATEWAY_INTERFACE' => string 'CGI/1.1' (length=7)
'SERVER_PROTOCOL' => string 'HTTP/1.1' (length=8)
'REQUEST_METHOD' => string 'GET' (length=3)
'QUERY_STRING' => string '' (length=0)
'REQUEST_URI' => string '/' (length=1)
'SCRIPT_NAME' => string '/index.php' (length=10)
'PHP_SELF' => string '/index.php' (length=10)
'REQUEST_TIME' => int 1370374014

Use namespace in API_BASE check

Currently, you can use or not use the namespace when defining API_BASE and it works. We should be explicitly checking the namespaced constant.

Allow more advanced User filtering

Being able to search by nickname would be quite good for SEF.

I can imagine there are other cases to add that could make user querying a bit more feature rich.

404 Problem in WP 3.7.1

Hi, I installed the plugin correctly, but each request returns me 404.
Can I help me?
Thanks for all

Support for Custom Fields?

I'm trying to access data from custom fields in our post types, however, the meta object is empty. Are custom fields supported? If not, what steps would I need to take to access custom field keys and values in the meta object?

Question about querying for custom taxonomies

I need to be able to query for posts within a custom taxonomy but am getting empty arrays of posts.

The custom taxonomy seems to work on the site and is explicit set as public: true.

This query works...

    http://domain.com?my_custom_taxonomy=xtest

And I've verified that the custom taxonomy functions in the admin console. I can add terms to the taxonomy and assign them to posts.

In my database I see...

    mysql> select * from wp_terms where name = 'xtest';
    +---------+-------+-------+------------+
    | term_id | name  | slug  | term_group |
    +---------+-------+-------+------------+
    |    1676 | xtest | xtest |          0 |
    +---------+-------+-------+------------+
    1 row in set (0.00 sec)

    mysql> select * from wp_term_taxonomy where taxonomy = 'my_custom_taxonomy';
    +------------------+---------+---------------------+-------------+--------+-------+
    | term_taxonomy_id | term_id | taxonomy            | description | parent | count |
    +------------------+---------+---------------------+-------------+--------+-------+
    |             1673 |    1672 | my_custom_taxonomy  |             |   1670 |     0 |
    |             1674 |    1673 | my_custom_taxonomy  |             |      0 |     2 |
    |             1675 |    1674 | my_custom_taxonomy  |             |   1673 |     2 |
    |             1676 |    1675 | my_custom_taxonomy  |             |   1674 |     2 |
    |             1677 |    1676 | my_custom_taxonomy  | xtest       |      0 |     1 |
    +------------------+---------+---------------------+-------------+--------+-------+
    5 rows in set (0.00 sec)

In your api I'm able to query for the actual taxonomy via the /taxonomies resource.

    http://domain.com/wp_api/v1/taxonomies/my_custom_taxonomy


    {
      name: "my_custom_taxonomy",
      post_types: [
        "post",
        "page"
      ],
      hierarchical: true,
      queryVar: "my_custom_taxonomy",
      labels: {
        name: "Custom Taxonomy",
        singular_name: "Custom Taxonomy",
        search_items: "Search Taxonomies",
        popular_items: null,
        all_items: "Custom Taxonomy",
        parent_item: "Parent Taxonomy",
        parent_item_colon: "Parent Taxonomy:",
        edit_item: "Edit Taxonomy",
        view_item: "View Taxonomy",
        update_item: "Update Taxonomy",
        add_new_item: "Add New Taxonomy",
        new_item_name: "New Taxonomy Name",
        separate_items_with_commas: null,
        add_or_remove_items: null,
        choose_from_most_used: null,
        menu_name: "Custom Taxonomy",
        name_admin_bar: "Custom Taxonomy"
      },
      meta: { }
    }

But when I try to use the Thermal API I only receive an empty array of posts

    http://domain.com/wp_api/v1/posts?taxonomy[my_custom_taxonomy]=1676 (note: I've tried every number in the list)
    http://domain.com/wp_api/v1/posts?taxonomy[my_custom_taxonomy]=[1676] (note: I've tried every number in the list)
    http://domain.com/wp_api/v1/posts?taxonomy[my_custom_taxonomy]=xtest
    http://domain.com/wp_api/v1/posts?taxonomy[my_custom_taxonomy]=[xtest]

I'm running Wordpress 3.5.2 with Thermal API Stable tag: 0.7.5

I'm not sure what I am doing incorrectly. Any ideas? Your plugin works fine for querying for posts otherwise.

Allow response headers to be modified

I want to add a "Last-Modified" header. Right now I've hacked the plugin for myself using:

$res->header( 'Last-Modified', get_lastpostmodified() );

It works, but I would like to do it properly. How is the best way?

Extending the plugin

Not sure if I'm missing it, but I don't see any hooks that give me the possibility to extend the plugin and give the possibility to create my own JSON with some custom things I have.

I have used JSON API in a couple of projects to use WordPress with AngularJS web apps, and that's the only thing I'm missing from that plugin

Thanks

How can I get less data sent in the JSON response

for my application, I mostly want the
title
excerpt,
the URL to link to the Wordpress site
To reduce the amount of data sent with JSON, it would be great if I can select what key/value pairs are sent back.

Any idea on this?
Appreciated
Roestigraben

Authentication Support

Hi there,

I see authentication is on the road map - do you know when the Thermal API with Authentication will be available?

Thanks,
Michael

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.