GET /test/$ID

Test GET requests

Resource URL

Type URL and Format
GET https://public-api.wordpress.com/rest/v1/test/$ID

Method Parameters

Parameter Type Description
$ID (int) An arbitrary integer

Query Parameters

Parameter Type Description
http_envelope (bool)
false:
(default)
true:
Some environments (like in-browser Javascript or Flash) block or divert responses with a non-200 HTTP status code. Setting this parameter will force the HTTP status code to always be 200. The JSON response is wrapped in an "envelope" containing the "real" HTTP status code and headers.
pretty (bool)
false:
(default)
true:
Output pretty JSON
meta (string) Optional. Loads data from the endpoints found in the 'meta' part of the response. Comma separated list. Example: meta=site,likes
fields (string) Optional. Returns specified fields only. Comma separated list. Example: fields=ID,title
callback (string) An optional JSONP callback function.
id (int) Another arbitrary integer
default_string (string) Default: 'default'.
default_int (int) Default: 100.
boolean_whitelist_defaults_to_false (bool)
false:
(default) False
true:
True
boolean_whitelist_defaults_to_true (bool)
true:
(default) TRUE
false:
FALSE
string_whitelist_defaults_to_foo (string)
foo:
(default) Foolish
bar:
Barstow
url (url)
datetime (iso 8601 datetime)

Response Parameters

Parameter Type Description
method_id_matches_query_id (bool) Whether the arbitrary integer in the path matches the arbitrary integer in the query string.
method_id (int)
id (int) Another arbitrary integer
default_string (string)
default_int (int)
boolean_whitelist_defaults_to_false (bool)
boolean_whitelist_defaults_to_true (bool)
string_whitelist_defaults_to_foo (string)
url (url)
datetime (iso 8601 datetime)

Example

cURL

curl 'https://public-api.wordpress.com/rest/v1/test/123?pretty=1'

PHP

<?php

$options  = array (
  'http' => 
  array (
    'ignore_errors' => true,
  ),
);

$context  = stream_context_create( $options );
$response = file_get_contents(
  'https://public-api.wordpress.com/rest/v1/test/123?pretty=1',
  false,
  $context
);
$response = json_decode( $response );

?>

Response Body

{
    "method_id_matches_query_id": false,
    "method_id": 123,
    "id": null,
    "default_string": "default",
    "default_int": 100,
    "boolean_whitelist_defaults_to_false": false,
    "boolean_whitelist_defaults_to_true": true,
    "string_whitelist_defaults_to_foo": "foo",
    "url": null,
    "datetime": "2014-10-23T07:11:36+00:00"
}