DapperCamp Wiki > Documentation > Dapp Details Web Service

Dapp Details Web Service

Table of contents
No headers

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:

// assume the variable jsonString contains the JSON string returned by the web service
var dappDetails;
eval("dappDetails = " + jsonString + ";");
for (i in dappDetails) {
  document.write(i + "<br/>");
}


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.

Tag page
Viewing 2 of 2 comments: view all
Interesting post. I have been wondering about this issue, so thanks for posting. I’ll likely be coming back to your blog. Thanks ever so much, very great article! If you do not mind, please visit my article related to pandeglang district in Banten, Indonesia at Kenali dan Kunjungi Objek Wisata di Pandeglang or you can visit the second Kenali dan Kunjungi Objek Wisata di Pandeglang is very pleasure to meet you there. Thank you so much. Wedding Dresses Wholesale Wedding Dresses Wedding Dresses 2010 Beach Wedding Dresses A-Line Wedding Dresses Strapless Wedding Dresses
Posted 02:19, 9 Mar 2010
Truly, your piece goes to the nitty-gritty of the subject. Your clarity leaves me wanting to know more. Just so you know, i will immediately grab your feed to keep up to date with your web site. Sounding Out thanks is simply my little way of saying bravo for a solid resource. Accept my best wishes for your incoming post. bridal gowns bridal dresses Strapless Wedding Dresses Beach Wedding Dresses wedding dresses 2010
Posted 06:15, 12 Mar 2010
Viewing 2 of 2 comments: view all
You must login to post a comment.