Changes between Version 16 and Version 17 of RestApi


Ignore:
Timestamp:
30.10.2011 23:36:27 (11 years ago)
Author:
jri
Comment:

Adapt "Topics by type" example to page conventions

Legend:

Unmodified
Added
Removed
Modified
  • RestApi

    v16 v17  
    7979(The error response might become more HTTP/REST conform in the furure.) 
    8080 
    81 === Get topics by type_uri ===  
    82  
    83 {{{ 
    84 GET /core/topic/by_type/<type_uri> 
    85 }}} 
    86  
    87 ==== Example 1: Getting all topics of one type ==== 
    88  
    89  
    90 Requesting all topics of type "Web Resource" / "dm4.webbrowser.web_resource". 
    91  
    92 {{{ 
    93 curl http://localhost:8080/core/topic/by_type/dm4.webbrowser.web_resource | jsonpretty 
    94 }}} 
    95  
    96 Response (as of deepamehta-4.0.5): 
    97  
    98 {{{ 
    99 HTTP/1.1 200 OK 
    100 Content-Type: application/json 
    101  
    102 { 
     81=== Get topics by type ===  
     82 
     83{{{ 
     84GET /core/topic/by_type/<Type URI>[?fetch_composite=true/false] 
     85}}} 
     86 
     87The default for `fetch_composite` is `false`. 
     88 
     89==== Example: Getting all "Web Resource" topics ''without'' their `composite` values  ==== 
     90 
     91{{{ 
     92curl localhost:8080/core/topic/by_type/dm4.webbrowser.web_resource | jsonpretty 
     93}}} 
     94 
     95Response: 
     96 
     97{{{ 
     98HTTP/1.1 200 OK 
     99Content-Type: application/json 
     100 
     101{ 
     102   "total_count" : 2, 
    103103   "items" : [ 
    104104      { 
     105         "id" : 2436, 
     106         "uri" : "", 
    105107         "type_uri" : "dm4.webbrowser.web_resource", 
    106          "composite" : {}, 
    107108         "value" : "JSON Format - your online JSON Formatter", 
    108          "id" : 2436, 
    109          "uri" : "" 
     109         "composite" : {} 
    110110      }, 
    111111      { 
     112         "id" : 2259, 
     113         "uri" : "", 
    112114         "type_uri" : "dm4.webbrowser.web_resource", 
    113          "composite" : {}, 
    114115         "value" : "DeepaMehta 4.0.5", 
    115          "id" : 2259, 
    116          "uri" : "" 
     116         "composite" : {} 
    117117      } 
    118    ], 
    119    "total_count" : 2 
     118   ] 
    120119} 
    121120