The Dapp Details Web Service is a REST web service for obtaining metadata (such as description, tags, input variables, etc.) about a given Dapp. It is useful for, among other things, obtaining a list of fields a Dapp contains, a list of groups a Dapp contains, which inputs it takes, whether it requires login credentials, etc. It is called as follows:
http://www.dapper.net/websiteService...pName=DAPPNAME
So, for the Dapp with dappName MSNSearchResults, you would obtain its details by calling the following URL:
http://www.dapper.net/websiteService...NSearchResults
The web service returns its results in JSON format by default. You can specify an alternate format using the "mode" GET argument. Acceptable values include "json" (default), "xml", and "serialized". When "mode" is equal to "xml", the web service will return the results in XML format. When "mode" is equal to "serialized", the web service will return the results in PHP serialized format, which can be processed using the "unserialize" command in PHP (this is useful in versions of PHP which do not have json_decode). So, for example, to obtain the Dapp details in XML, you could call the following URL:
http://www.dapper.net/websiteService...sults&mode=xml
An example of the JSON format follows (some contents have been removed as they are irrelevant):
{
"dappFields":[
[
{
"fieldName":"URL",
},
{
"fieldName":"Number of Results",
"startConstraint":"of",
"endConstraint":"results",
},
{
"fieldName":"Description",
},
{
"fieldName":"Title",
}
]
],
"dappGroups":[
[
{
"groupName":"Search Result",
"dappFields":[
2,
0,
3
]
}
]
],
"dappTitle":"MSN Search Results",
"codeVersion":"209",
"dappUrls":[
"http:\/\/search.msn.com\/results.aspx?q=oranges",
"http:\/\/search.msn.com\/results.aspx?q=france",
"http:\/\/search.msn.com\/results.aspx?q=php",
"http:\/\/search.msn.com\/results.aspx?q=microsoft",
"http:\/\/search.msn.com\/results.aspx?q=jon+aizen"
],
"preMapEncoding":"utf-8",
"createDate":"2006-07-31 05:56:09",
"dappDescription":"The results of a search for a specific query at MSN",
"dappTags":[
"msn",
"search engine",
"search",
"microsoft"
],
"chocolateChip":"2697177c08812286c8326d7d90928c35",
"userId":"8",
"variableUrl":"http:\/\/search.msn.com\/results.aspx?q={Query}",
"htmlParserName":"tagsoup",
"updateDate":"2007-10-31 17:46:40",
"urlVariables":[
"Query"
]
}
Each property (e.g., "updateDate") can have as its value either a singleton value or an array, depending on the type of value. For example, "updateDate" has a string value (e.g., "2007-10-31 17:46:40"), where as "dappTags" has an array value (e.g., ["dapper", "france", "etc"]). More complex types have nested varieties of hashes, arrays, strings, and booleans. Just play with the output. A snippet of Javascript that can print all the available keys is:
A snippet of code to get all the names of all the fields is:
// assume the variable dappDetails contains the object returned by parsing the JSON string from the web service
var dappFieldNames = [];
for (i in dappDetails['dappFields'][0]) {
dappFieldNames.push(dappDetails['dappFields'][0][i]['fieldName');
}
For an example of the XML format, see:
http://www.dapper.net/websiteService...sults&mode=xml
So, in the above XML, you can access the names of the Dapp fields by accessing the following XPath:
/dapp/dappFields/dappField/dappField/fieldName
Feel free to post additional code snippets an examples in this page.