update api docs

This commit is contained in:
rolux 2014-11-18 15:57:16 +00:00
parent acee02f368
commit e4842e023e

View file

@ -73,21 +73,32 @@ def findAnnotations(request, data):
''' '''
takes { takes {
query: { query: {
conditions: [], conditions: [{
operator: '&' key: string,
operator: string,
value: string
}],
operator: string // '&' or '|'
}, },
itemsQuery: { itemsQuery: {
conditions: [], conditions: [{
operator: '&' key: string,
operator: string,
value: string
}],
operator: string // '&' or '|'
}, },
keys: [], keys: [],
position: int, position: int,
positions: [], positions: [],
range: [in, out], range: [int, int],
sort: [] sort: []
} }
returns { returns {
annotations = [{..}, {...}, ...] annotations: [{
id: string,
...
}]
} }
''' '''
response = json_response() response = json_response()
@ -118,12 +129,14 @@ actions.register(findAnnotations)
def getAnnotation(request, data): def getAnnotation(request, data):
''' '''
Gets data for an annotation
takes { takes {
id: string, id: string, // annotation id
keys: [string] keys: [string] // list of keys to return
} }
returns { returns {
key: value key: value,
...
} }
''' '''
response = json_response({}) response = json_response({})
@ -218,11 +231,13 @@ actions.register(addAnnotations, cache=False)
@login_required_json @login_required_json
def removeAnnotation(request, data): def removeAnnotation(request, data):
''' '''
Removes an annotation
takes { takes {
id: annotationId id: string // annotation id
} }
returns { returns {
} }
FIXME: returns nothing?
''' '''
response = json_response({}) response = json_response({})
a = get_object_or_404_json(models.Annotation, public_id=data['id']) a = get_object_or_404_json(models.Annotation, public_id=data['id'])
@ -238,14 +253,15 @@ actions.register(removeAnnotation, cache=False)
@login_required_json @login_required_json
def editAnnotation(request, data): def editAnnotation(request, data):
''' '''
Edits an annotation
takes { takes {
id:, id: string, // annotation id
in: float, in: float, // in point in seconds, optional
out: float, out: float, // out point in seconds, optional
value: string, value: string // annotation value, optional
} }
returns { returns {
id: id: string, // annotation id
... ...
} }
''' '''