Difference between revisions of "YTMND:API:Response Formats"
From YTMND
(→Response Formats) |
|||
(3 intermediate revisions by 2 users not shown) | |||
Line 1: | Line 1: | ||
==Response Formats== | ==Response Formats== | ||
+ | |||
+ | Response format is specified by the GET variable "return". The following formats are currently available: | ||
+ | |||
{| width="100%" style="text-align:left; background-color:transparent; border: solid 1px #c30" | {| width="100%" style="text-align:left; background-color:transparent; border: solid 1px #c30" | ||
|- style="background-color:#c30; color:#fff;" | |- style="background-color:#c30; color:#fff;" | ||
Line 10: | Line 13: | ||
| http://api.ytmnd.com/site/1/basic?return=xml | | http://api.ytmnd.com/site/1/basic?return=xml | ||
|- style="background-color:#fbfbfb" | |- style="background-color:#fbfbfb" | ||
− | | [ | + | | [http://json.org/ JSON] |
| May be directly evaluated in JavaScript, and also can be parsed in many languages. | | May be directly evaluated in JavaScript, and also can be parsed in many languages. | ||
| http://api.ytmnd.com/site/1/basic?return=json | | http://api.ytmnd.com/site/1/basic?return=json | ||
Line 18: | Line 21: | ||
| http://api.ytmnd.com/site/1/basic?return=js&callback=yourfunctionname | | http://api.ytmnd.com/site/1/basic?return=js&callback=yourfunctionname | ||
|- style="background-color:#fbfbfb" | |- style="background-color:#fbfbfb" | ||
− | | [ | + | | [http://www.php.net/manual/en/function.unserialize.php Serialized PHP] |
| Easily unserialized in PHP to create objects, to which the programmer can attach custom methods. Or the programmer can directly access the response data through the public properties of the objects. | | Easily unserialized in PHP to create objects, to which the programmer can attach custom methods. Or the programmer can directly access the response data through the public properties of the objects. | ||
| http://api.ytmnd.com/site/1/basic?return=phps | | http://api.ytmnd.com/site/1/basic?return=phps | ||
+ | |- style="background-color:#fbfbfb" | ||
+ | | [http://www.yaml.org/ YAML] | ||
+ | | words here. | ||
+ | | http://api.ytmnd.com/site/1/basic?return=yaml | ||
+ | |- style="background-color:#fbfbfb" | ||
+ | | DEBUG | ||
+ | | An easily readable variable dump with typing for debugging purposes. | ||
+ | | http://api.ytmnd.com/site/1/basic?return=debug | ||
|} | |} |
Latest revision as of 19:24, October 21, 2007
Response Formats
Response format is specified by the GET variable "return". The following formats are currently available:
Type | Description | Example |
---|---|---|
XML (default) | Easily parsed in many languages on many platforms. It is particularly easy to use in Flash applications. Visual representation makes it easy for a person to simply view the data. | http://api.ytmnd.com/site/1/basic?return=xml |
JSON | May be directly evaluated in JavaScript, and also can be parsed in many languages. | http://api.ytmnd.com/site/1/basic?return=json |
JavaScript | Useful as the source of a script tag, it passes JSON response to the JavaScript callback function you specify. | http://api.ytmnd.com/site/1/basic?return=js&callback=yourfunctionname |
Serialized PHP | Easily unserialized in PHP to create objects, to which the programmer can attach custom methods. Or the programmer can directly access the response data through the public properties of the objects. | http://api.ytmnd.com/site/1/basic?return=phps |
YAML | words here. | http://api.ytmnd.com/site/1/basic?return=yaml |
DEBUG | An easily readable variable dump with typing for debugging purposes. | http://api.ytmnd.com/site/1/basic?return=debug |