All the following API(expect OAUTH) must have Authorization parameter in Http Header.
Authorization: Token 13sdfs32fsadf
The default response is in json, if you want the response in other format, please add parameter "format=XML", "format=YAML", etc.
If anything goes south, you will get a error response:
{
'status': 'error',
'reason': '<err_reason>',
}
POST /auth/oauth/(baidu|google)/login
GET /auth/oauth/(baidu|google)/complete&...
#GET /user/<uid>
GET /project/project # list my project
POST /project/project # add
GET /project/<pid> # login
PUT /project<pid> # modify
DELETE /project<pid> # delete
POST /project/<pid>/collaborator/<uid>
DELETE /project/<pid>/collaborator/<uid>
GET /data/(node|link)/<id>
POST /data/(node|link)
DELETE /data/(node|link)/<ref_id>
PATCH /data/node/<ref_id>
PUT /data/(node|link)/<id>
GET /data/project/<pid>
GET /data/(node|link)/<ref_id>/link @zhaosensen
POST /search/(node|link)
POST /search/user
POST /search/project
POST /algorithm/shortestpath
POST /algorithm/blastn
request:
POST /auth/oauth/(baidu|google)/login
When the user login in sucessfully, the pages will redict to the /auth/oauth/<baidu|google>/complete
request(automaticlly):
GET /auth/oauth/(baidu|google)/complete&....
success :
{
"status": "success",
"token": "16517d0809f225b7b65a79ef1dc8c552441bf58a",
"uid": 8,
"googleid": "zhoulong6@gmail.com",
[或者"baiduid": "347238434"]
}
request:
GET .org/project/project (**没有s**)
response:
{
'status':'success',
'resultes':
[
...
]
}
request:
POST .org/project/project
prj_name:<string>
[species:<string>]
[description:<string>]
response:
{
'status':'success',
'pid':...
}
request:
GET .org/project/<pid>
success response:
{
'status': 'success',
'result':
{
'pid':....,
'prj_name':...,
'author':...,
'authorid':...,
'species':...,
'description':...,
'collaborators':
[1, 5, ...
]
}
}
request:
DELETE .org/project/<pid>
response:
{
'status':'success'
}
request:
PUT .org/project/<pid>
request体(类似POST):
name : ...,
species: ...,
description:...
request:
POST .org/project/<pid>/collaborator
uid:<uid>
response:
{
'status':'success'
}
request:
DELETE .org/project/<pid>/collaborator/<uid>
response:
{
'status':'success'
}
request:
POST .org/auth/logout
response:
{
'status': 'success‘,
}
request:
GET /data/(node|link)/<ref_id>
response:
{
I'm results
}
request:
POST /data/(node|link)
info:
{
'TYPE': 'Gene',
'NAME': 'trnL',
...
}
x: 123.123131
y: 321314.324
pid: 12
----
PS:
x,y(float) is optional
pid,info are required
response:
{
'ref_id': '<ref_id>'
}
request:
PUT /data/(node|link)/<node\link_id>/
pid: 23
x: 123.123
y: -213.231
response:
{
'ref_id': '<ref_id>'
}
request:
PATCH /data/(node|link)/<ref_id
x: 1231.123
y: 232.234234
request:
DELETE /data/(node|link)/<ref_id>
response:
{
'status': 'success‘,
}
request:
GET /data/project/<pid>
response:
{
'status': 'success',
'node': [
{},{}...
],
'link': [
{},{}..
],
}
request:
POST /search/(node|link)
method:query
spec:{}
fields:{}
skip:[INTEGER]
limit:[INTEGER]
default:
skip:0
limit:infinite
response:
{
results:
[
{
'_id':'53f455e1af4bd63ddccee4a3',
'NAME':'ehrL',
'TYPE':'Gene',
'....':'...'
},
{
'_id':'53f455e1af4bd63ddccee4a4'
'NAME':'thrA',
'TYPE':'Gene',
'....':'...'
}
]
}
request :
POST /search/(node|link)
'spec':
{
"$and":
[
{"$or":
[
{"key1":"abc"},
{"key2":123},
{"key3":"sfda"}
]},
{"key4":"feiyicheng"}
]
}
explain:
(key1 || key2 || key3) && key4
request:
POST /search/(node|link)
'spec':
{
"age":
{
"$gt":18
}
}
explain:
< : "$lt"
> : "$gt"
<= : "$le"
>= : "$ge"
!= : "$ne"
only return ID, NAME and TYPE fileds
request:
POST /search/(node|link)
spec:
{
}
field:
{
'NAME':True,
'TYPE':True
}
return all fileds except NAME
request:
POST /search/(node|link)
'spec':
{
}
'field':
{
'NAME':False
}
request:
POST /search/user
name: <name>
----
PS: It will be fuzzy search
eg:
POST /search/user
name: zhoulo
response:
{
'status': 'success',
'results':
[
{
'username': <username>,
'first_name': <first_name>,
'last_name': <last_name>,
'id':<uid>,
},
{}...
]
}
request:
POST /search/project
query: <query>
PS: query must conform the json format, and all the fields are shown as following:
'name','author','authorid',
response:
{
'status': 'success',
'results':
{
{
'pid':...,
'name':...,
'authorid':...,
'collaborators':
[
2,412,4...
]
},
{}...
}
}
request:
POST /algorithm/shortestpath
ID1:<string>
ID2:<string>
global:[boolean]
default:
global:False
response:
{
results:
[
{
node:[1,2,3,4,5],
link:[12,23,34,45]
},
{
node:[1,2,7,8,9,10,11],
link:[......]
}
]
}
request:
POST /algorithm/blastn
//TODO