Talk:Sugar Network/API: Difference between revisions
Appearance
Created page with "= Some basic examples for beginning the implementation of basic client = == Browsing a list of contexts == '''Get''' the list: http://localhost/context?offset=0&limit=2&prope..." |
m Alsroot moved page Talk:Platform Team/Sugar Network/API to Talk:Sugar Network/API |
||
| (One intermediate revision by one other user not shown) | |||
| Line 26: | Line 26: | ||
''Get'': | ''Get'': | ||
http://localhost/question?request= | http://localhost/question?request=context:SOMEHASH&offset=0&limit=20&properties=title,content,rating,vote,guid&order_by=-mtime | ||
In this example there's only one question associated with this context: | In this example there's only one question associated with this context: | ||
Latest revision as of 05:20, 4 July 2013
Some basic examples for beginning the implementation of basic client
Browsing a list of contexts
Get the list:
http://localhost/context?offset=0&limit=2&properties=title,description,guid&order_by=-mtime
Default order is by modification time.
This would output an array of dictionaries:
[[{key: value}], total]
For example:
[[{'title':'Actividad Navegar',
'description':'La actividad navegar...',
'guid':'SOMEHASH'},
{'title':'Actividad Escribir',
'description':'La actividad escribir...',
'guid':'SOMEOTHERHASH'}], 10]
Browsing questions associated with resources
Get:
http://localhost/question?request=context:SOMEHASH&offset=0&limit=20&properties=title,content,rating,vote,guid&order_by=-mtime
In this example there's only one question associated with this context:
[[{'title':'Se puede añadir un buscador?',
'content':'Otros navegadores incluyen un buscador...',
'rating': 0,
'guid' : 'OTHERHASH',
'vote': False}], 1]
Modifying a property
Put:
http://localhost/question/OTHERHASH
With sending a dictionary. For instance for voting: {vote: True} (Voting consists only of a boolean, as in +1, or Star)