Changes between Version 3 and Version 4 of WifidogAPI

Show
Ignore:
Timestamp:
10/05/09 14:32:25 (10 years ago)
Author:
gbastien
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • WifidogAPI

    v3 v4  
    4646Here are the possible parameters 
    4747||'''Parameter''' ||'''Possible values'''||'''Description'''|| 
    48 ||action||get,list|| What kind of action is requested from the service || 
     48||action||get,list,auth|| What kind of action is requested from the service || 
    4949||object_class||user, node, network|| What kind of data is requested || 
    5050||object_id|| || The object id of the object whose details are being requested|| 
    5151||fields || ||The fields to return || 
    52 ||f (optional default:json)||json,xml|| The format of the response (only json would be implemented for now) || 
    53 ||v (optional default:1.0)||1.0|| The version of the web service protocol (to be forward compatible, just in case) || 
     52||f (optional default:json)||json,xml|| The format of the response || 
     53||v (optional default:1)||1|| The version of the web service protocol (to be forward compatible, just in case) || 
     54||additional parameters|| || any additional parameter needed by the requested action || 
    5455 
    5556A typical request would look like this 
    5657{{{ 
    57 /ws/index.php?action=list&object_class=Node&&fields=name,connectedusers&f=json&v=1.0 
     58/ws/index.php?action=list&object_class=Node&object_id=1234&fields=name,connectedusers&f=json&v=1.0 
    5859}}} 
    5960 
     
    6263{ 
    6364    { 
    64         "name":"hotspot1name", 
    65         "connectedusers": 
    66          {  
    67              "user1":  
    68              { 
    69                  "name":"user1name" 
    70                  "url":"user1url" 
    71              } 
    72              "user2": 
    73              { 
     65        "result":"1", 
     66        "values": 
     67        [{ 
     68           "name":"hotspot1name", 
     69           "connectedusers": 
     70            {  
     71               "user1":  
     72               { 
     73                  "name":"user1name" 
     74                  "url":"user1url" 
     75               } 
     76               "user2": 
     77               { 
    7478                  "name":"user2name", 
    7579                  "url":"user2url" 
    76              } 
    77          } 
    78     }, 
    79     { 
    80          "name":"network2name", 
    81          ... 
     80               } 
     81            } 
     82         }, 
     83         { 
     84            "name":"network2name", 
     85            ... 
     86         }] 
    8287    } 
    8388} 
    8489}}} 
     90 
     91Should an exception occur in the web service, it would be returned in the requested format of output like this: 
     92{{{ 
     93{    
     94    "result":0, 
     95    "values": 
     96    { 
     97        "type":"WSException", 
     98        "message":"Detailed error was: Uncaught WSException Action gabc is not defined. Please use GET parameter 'action=list|get|auth' to specify an action (0) thrown in file /var/www/wifidog-auth/wifidog/ws/classes/WifidogWS/V1.php, line 114" 
     99    } 
     100} 
     101}}} 
     102 
     103The equivalent XML string would be the keys as element names the values as value.  Unkeyed elements will be enclosed in a <item></item> tag.  The top-level Xml tag is <WiFiDogWebService> 
    85104 
    86105=== Some thoughts to keep in mind ===