Changes between Version 15 and Version 16 of RestApi


Ignore:
Timestamp:
30.10.2011 18:14:37 (11 years ago)
Author:
Malte
Comment:

introduced example of how to get all topic instances for one given type_uri

Legend:

Unmodified
Added
Removed
Modified
  • RestApi

    v15 v16  
    7878If the topic doesn’t exist an error `500 Retrieving topic xy failed` is returned. 
    7979(The error response might become more HTTP/REST conform in the furure.) 
     80 
     81=== Get topics by type_uri ===  
     82 
     83{{{ 
     84GET /core/topic/by_type/<type_uri> 
     85}}} 
     86 
     87==== Example 1: Getting all topics of one type ==== 
     88 
     89 
     90Requesting all topics of type "Web Resource" / "dm4.webbrowser.web_resource". 
     91 
     92{{{ 
     93curl http://localhost:8080/core/topic/by_type/dm4.webbrowser.web_resource | jsonpretty 
     94}}} 
     95 
     96Response (as of deepamehta-4.0.5): 
     97 
     98{{{ 
     99HTTP/1.1 200 OK 
     100Content-Type: application/json 
     101 
     102{ 
     103   "items" : [ 
     104      { 
     105         "type_uri" : "dm4.webbrowser.web_resource", 
     106         "composite" : {}, 
     107         "value" : "JSON Format - your online JSON Formatter", 
     108         "id" : 2436, 
     109         "uri" : "" 
     110      }, 
     111      { 
     112         "type_uri" : "dm4.webbrowser.web_resource", 
     113         "composite" : {}, 
     114         "value" : "DeepaMehta 4.0.5", 
     115         "id" : 2259, 
     116         "uri" : "" 
     117      } 
     118   ], 
     119   "total_count" : 2 
     120} 
     121 
     122}}} 
    80123 
    81124=== Create topic ===