- Install Python v3.5.2
- Install Django v1.10.4
- git clone https://github.com/kevintatou/idela_API.git
- pip install pymongo
- pip install django-cors-headers
- cd idela_API
- Run server
- For Windows Users: windows.bat
- For Linux Users: bash linux.sh
- Go to localhost:8000/
Note: Proper SSH key is required.
/get/key
=value
Gets everythings where `key`=`value`.
/get/key1
=value1
&key2
=value2,value3
Gets everythings where `key`=`value` and `key2`=`value2` and `value3`.
"col": str, "desc": str, "fname": str, "lname": str, "id": str, "public": int, "tags": str, "views": int, "trend": int, "media": int, "date": int, "alias": str, "weekly": int, "nodes": str, "email": str, "owners": str, "members": str, "comment" : str, "type": str, "token_type": str, "token_value": str
/get/col
=node
Gets all documents from "collection" named "node" in the database.
/get/col
=node
&owners
=liam
Gets all documents from "collection" named "node" in the database
where key is "owners" and has the value "liam".
/get/col
=node
&members
=liam,kevin
Gets all documents from "collection" named "node" in the database
where key is "owners" and has the value "liam" and "kevin".
/post
[
{
"key": "value",
"key2": "value2",
"key3": "value3,value4"
}
]
Posts a json object to /post with keys including values
"col": "user"
"fname": ",
"lname": "",
"email": "",
"token_type": "",
"token_value": ""
"col": "node",
"tags": "",
"name": "",
"type": "",
"public": "",
"owners": ""
"col": "tags",
"name": ""
"col": "user",
"alias": "",
"firstname": "",
"lastname": "",
"email": "",
"desc": "",
"tokens" "",
"nodes": "",
"image": "",
"views": 0,
"weekly": 0,
"trending": 0,
"level": 0,
"comment": ""
"col": "node",
"weekly": 0,
"tags": "",
"desc": "",
"comment": "",
"rating": "",
"name": "",
"public": 0,
"token": "",
"image": "",
"media": "",
"views": 0,
"owners": "",
"members": "",
"trending": 0,
"quality_score": 0,
"opinion_score": 0,
"relevance_score": 0,
"opinion_votes": 0,
"quality_votes": 0,
"relevance_votes": 0
"col": "tags"
"name": "",
"desc": "",
"nodes": ""
/post
[
{
"col": "node",
"tags": "github,code",
"name": "Bob the Coder",
"public": 1,
"owners": "0560940564",
"members": "095609507 04793912"
}
]
Requests a json object to post. Request want to be put in node collection "col": "node"
in DB with keys containing a value "name": "Bob the Coder"
ect. The tags key "tags": "github,code"
gets split by comma into a array of strings ["github","code"]
, meaning the node gets two tags not a single tag. The same goes with members key. Note that owners
and members
values are MongoDB ObjectID(s).
When posting a node tags related to that node get automaticly updated and new tags get created if they dont exist in the database.