-
Notifications
You must be signed in to change notification settings - Fork 14
Quick Start Guide
The design principle of cyREST is simple: make programmer-friendly, easy-to-use REST API for Cytoscape users. These days, almost all popular web services including Google, Twitter, and Facebook have REST API. They are following basic RESTful API design principles and once you learn one of them, it is relatively easy to learn others because they simply map their operations on data objects to basic HTTP operations, which are Create (POST), Read (GET), Update (PUT), and Delete (DELETE).
cyREST follows this design principle. Operations on Cytoscape data objects and functions are mapped to CRUD.
-
Get all networks as a list of SUIDs
GET http://localhost:1234/v1/networks
* Get Visual Style names
GET http://localhost:1234/v1/styles
* Get Visual Style named _Directed_ as JSON
GET http://localhost:1234/v1/styles/Directed
* GET list of layout algorithms
GET http://localhost:1234/v1/apply/layouts
* Apply _force-directed_ layout to network with SUID 53
GET http://localhost:1234/v1/apply/layouts/force-directed/53
### Create new objects in Cytoscape
* Send network and tables as JSON
* Network to be sent:
```JSON
{
"data": {
"name": "my network 1"
},
"elements": {
"nodes":[...],
"edges":[...]
}
}
POST http://localhost:1234/v1/networks
-
Add new nodes to existing network with SUID 52
PUT http://localhost:1234/v1/networks/52
#### Delete existing objects
* Delete all networks in current session
DELETE http://localhost:1234/v1/networks
* Delete a network with SUID 52
DELETE http://localhost:1234/v1/networks/52
* Delete a node with SUID 1200
DELETE http://localhost:1234/v1/networks/52/nodes/1200
© 2014-2015 The Cytoscape Consortium
Developed and Maintained by Keiichiro Ono (UC, San Diego Trey Ideker Lab)