Skip to content
Snippets Groups Projects

api doc updated

Merged Piotr Gawron requested to merge 131-rest-api-documentation into master
1 file
+ 154
44
Compare changes
  • Side-by-side
  • Inline
+ 154
44
@@ -43,9 +43,10 @@ curl -X GET --cookie "MINERVA_AUTH_TOKEN=xxxxxxxx" http://pg-sandbox.uni.lu/mine
curl -X POST -c - --data "login=anonymous&password=" http://pg-sandbox.uni.lu/minerva/api/doLogin
```
* Login:
* Logout:
* URL: `/doLogout`
* Method: POST
* Parameters: *NONE*
* Example:
```
curl -X POST -c - http://pg-sandbox.uni.lu/minerva/api/doLogout
@@ -66,9 +67,9 @@ curl -X GET --cookie "MINERVA_AUTH_TOKEN=xxxxxxxx" http://pg-sandbox.uni.lu/mine
* URL: `/genomics/taxonomies/{organismId}/genomeTypes/{type}/versions/{version}/`
* Method: GET
* Parameters:
* organismId - identifier of the organism in taxonomy db
* type - type of genome (database from which reference genome should be used), for now only UCSC is supported
* version - version of the reference genome
* `organismId` - identifier of the organism in taxonomy db
* `type` - type of genome (database from which reference genome should be used), for now only UCSC is supported
* `version` - version of the reference genome
* Example:
```
curl -X GET --cookie "MINERVA_AUTH_TOKEN=xxxxxxxx" http://pg-sandbox.uni.lu/minerva/api/genomics/taxonomies/9606/genomeTypes/UCSC/versions/hg19/
@@ -80,7 +81,7 @@ curl -X GET --cookie "MINERVA_AUTH_TOKEN=xxxxxxxx" http://pg-sandbox.uni.lu/mine
* URL: `/projects/{projectId}/`
* Method: GET
* Parameters:
* projectId - identifier of the project
* `projectId` - identifier of the project
* Example:
```
curl -X GET --cookie "MINERVA_AUTH_TOKEN=xxxxxxxx" http://pg-sandbox.uni.lu/minerva/api/projects/pdmap_dec15/
@@ -90,7 +91,7 @@ curl -X GET --cookie "MINERVA_AUTH_TOKEN=xxxxxxxx" http://pg-sandbox.uni.lu/mine
* URL: `/projects/{projectId}:downloadSource`
* Method: GET
* Parameters:
* projectId - identifier of the project
* `projectId` - identifier of the project
* Example:
```
curl -X GET --cookie "MINERVA_AUTH_TOKEN=xxxxxxxx" http://pg-sandbox.uni.lu/minerva/api/projects/pdmap_jun16:downloadSource --output some.file
@@ -100,7 +101,11 @@ curl -X GET --cookie "MINERVA_AUTH_TOKEN=xxxxxxxx" http://pg-sandbox.uni.lu/mine
* Download map as a model file (ie. in CellDesigner format)
* URL: `/projects/{projectId}/models/{modelId}:downloadModel`
* Method: GET
* Parameters: TODO,
* Parameters:
* `projectId` - identifier of the project
* `modelId` - identifier of the (sub)map in the project
* `handlerClass` - class preparing model file. For list of all possible values check `/configuration/` response.
* polygonString (\*) - polygon defining part of the model for downloading
* See also `/configuration/` query to get list of possible formats
* Example:
```
@@ -110,7 +115,14 @@ curl -X GET --cookie "MINERVA_AUTH_TOKEN=xxxxxxxx" "http://pg-sandbox.uni.lu/min
* Download map as an image
* URL: `/projects/{projectId}/models/{modelId}:downloadImage`
* Method: GET
* Parameters: TODO,
* Parameters:
* `projectId` - identifier of the project
* `modelId` - identifier of the (sub)map in the project
* `handlerClass` - class preparing image file. For list of all possible values check `/configuration/` response.
* `backgroundOverlayId` (\*) - identifier of the overlay used as a background overlay when creating image
* `overlayIds` (\*) - comma separated list of overlay identifiers that should be included in the image
* `zoomLevel` (\*) - zoom level at which image should be generated (min value used by default)
* `polygonString` (\*) - polygon defining part of the model for downloading
* See also `/configuration/` query to get list of possible formats
* Example:
```
@@ -121,8 +133,10 @@ curl -X GET --cookie "MINERVA_AUTH_TOKEN=xxxxxxxx" "http://pg-sandbox.uni.lu/min
* URL: `/projects/{projectId}/models/{modelId}/bioEntities/elements/`
* Method: GET
* Parameters:
* `columns` - set of columns. Possible values are: id, modelId, name, type, description, symbol, complexId, compartmentId, fullName, abbreviation, formula, name, synonyms, formerSymbols, references, bounds, hierarchyVisibilityLevel,
* `ids` - set of database ids
* `projectId` - identifier of the project
* `modelId` - identifier of the (sub)map in the project or wildcard '*' character
* `columns` (\*) - set of columns (optional). Possible values are: id, modelId, name, type, description, symbol, complexId, compartmentId, fullName, abbreviation, formula, name, synonyms, formerSymbols, references, bounds, hierarchyVisibilityLevel,
* `ids` (\*)- set of database ids (optional)
* Example:
```
curl -X GET --cookie "MINERVA_AUTH_TOKEN=xxxxxxxx" http://pg-sandbox.uni.lu/minerva/api/projects/pdmap_dec15/models/*/bioEntities/elements/?columns=id,name,type
@@ -132,8 +146,11 @@ curl -X GET --cookie "MINERVA_AUTH_TOKEN=xxxxxxxx" http://pg-sandbox.uni.lu/mine
* URL: `/projects/{projectId}/models/{modelId}/bioEntities/reactions/`
* Method: GET
* Parameters:
* `columns` - set of columns. Possible values are:
* `ids` - set of database ids
* `projectId` - identifier of the project
* `modelId` - identifier of the (sub)map in the project or wildcard '*' character
* `columns` (\*) - set of columns. Possible values are: id, reactionId, modelId, type, lines, centerPoint, products, reactants, modifiers, hierarchyVisibilityLevel, notes
* `ids` (\*) - set of database ids
* `participantId` (\*) - identifier of the element that should be part of the reaction
* Example:
```
curl -X GET --cookie "MINERVA_AUTH_TOKEN=xxxxxxxx" http://pg-sandbox.uni.lu/minerva/api/projects/pdmap_dec15/models/*/bioEntities/reactions/?columns=id,name,type
@@ -142,7 +159,13 @@ curl -X GET --cookie "MINERVA_AUTH_TOKEN=xxxxxxxx" http://pg-sandbox.uni.lu/mine
* Search:
* URL: `/projects/{projectId}/models/{modelId}/bioEntities:search`
* Method: GET
* Parameters: TODO
* Parameters:
* `projectId` - identifier of the project
* `modelId` - identifier of the (sub)map in the project or wildcard '*' character
* `query` (\*) - search term identifing bioEntity
* `coordinates` (\*) - coordinates where bioEntity should be located
* `count` (\*) - max number of bioEntities to return
* `perfectMatch` (\*) - true when true query must be matched exactly, if false similar results are also acceptable
* Example:
```
curl -X GET --cookie "MINERVA_AUTH_TOKEN=xxxxxxxx" http://pg-sandbox.uni.lu/minerva/api/projects/pdmap_dec15/models/*/bioEntities:search?query=SNCA
@@ -151,7 +174,9 @@ curl -X GET --cookie "MINERVA_AUTH_TOKEN=xxxxxxxx" http://pg-sandbox.uni.lu/mine
* Suggested search queries:
* URL: `/projects/{projectId}/models/{modelId}/bioEntities/suggestedQueryList`
* Method: GET
* Parameters: TODO
* Output: List of suggested queries for search mechanism.
* Parameters:
* `projectId` - identifier of the project
* Example:
```
curl -X GET --cookie "MINERVA_AUTH_TOKEN=xxxxxxxx" http://pg-sandbox.uni.lu/minerva/api/projects/pdmap_dec15/models/*/bioEntities/suggestedQueryList
@@ -161,7 +186,11 @@ curl -X GET --cookie "MINERVA_AUTH_TOKEN=xxxxxxxx" http://pg-sandbox.uni.lu/mine
#### Chemicals
* URL: `/projects/{projectId}/chemicals:search`
* Method: GET
* Parameters: TODO
* Parameters:
* `projectId` - identifier of the project
* `columns` (\*) - set of columns for each result. Possible values are: name, references, description, directEvidenceReferences, directEvidence, synonyms, id, targets,
* `query` (\*) - chemical name
* `target` (\*) - target for which we are lookig for chemicals. Target is defined as TYPE:ID. For example "ALIAS:534" is searching for chemicals that target Alias with id=534.
* Example:
```
curl -X GET --cookie "MINERVA_AUTH_TOKEN=xxxxxxxx" "http://pg-sandbox.uni.lu/minerva/api/projects/pdmap_dec15/chemicals:search?query=rotenone"
@@ -171,7 +200,11 @@ curl -X GET --cookie "MINERVA_AUTH_TOKEN=xxxxxxxx" "http://pg-sandbox.uni.lu/min
* List comments
* URL: `/projects/{projectId}/comments/models/{modelId}/`
* Method: GET
* Parameters: TODO
* Parameters:
* `projectId` - identifier of the project
* `modelId` - identifier of the (sub)map in the project or wildcard '*' character
* `columns` (\*) - set of columns for each result. Possible values are: title, type, content, removed, coord, modelId, elementId, id, pinned, author, email,
* `removed` (\*) - if defined then removed paramter must match.
* Example:
```
curl -X GET --cookie "MINERVA_AUTH_TOKEN=xxxxxxxx" "http://pg-sandbox.uni.lu/minerva/api/projects/pdmap_dec15/comments/models/*/"
@@ -180,7 +213,12 @@ curl -X GET --cookie "MINERVA_AUTH_TOKEN=xxxxxxxx" "http://pg-sandbox.uni.lu/min
* Reaction comments
* URL: `/projects/{projectId}/comments/models/{modelId}/bioEntities/reactions/{reactionId}`
* Method: GET
* Parameters: TODO
* Parameters:
* `projectId` - identifier of the project
* `modelId` - identifier of the (sub)map in the project or wildcard '*' character
* `reactionId` - identifier of the reaction
* `columns` (\*) - set of columns for each result. Possible values are: title, type, content, removed, coord, modelId, elementId, id, pinned, author, email,
* `removed` (\*) - if defined then removed paramter must match.
* Example:
```
curl -X GET --cookie "MINERVA_AUTH_TOKEN=xxxxxxxx" http://pg-sandbox.uni.lu/minerva/api/projects/pdmap_dec15/comments/models/15305/bioEntities/reactions/187811/
@@ -189,7 +227,12 @@ curl -X GET --cookie "MINERVA_AUTH_TOKEN=xxxxxxxx" http://pg-sandbox.uni.lu/mine
* Element comments
* URL: `/projects/{projectId}/comments/models/{modelId}/bioEntities/elements/{elementId}`
* Method: GET
* Parameters: TODO
* Parameters:
* `projectId` - identifier of the project
* `modelId` - identifier of the (sub)map in the project or wildcard '*' character
* `elementId` - identifier of the element
* `columns` (\*) - set of columns for each result. Possible values are: title, type, content, removed, coord, modelId, elementId, id, pinned, author, email,
* `removed` (\*) - if defined then removed paramter must match.
* Example:
```
curl -X GET --cookie "MINERVA_AUTH_TOKEN=xxxxxxxx" http://pg-sandbox.uni.lu/minerva/api/projects/pdmap_dec15/comments/models/15305/bioEntities/elements/431868/
@@ -198,13 +241,26 @@ curl -X GET --cookie "MINERVA_AUTH_TOKEN=xxxxxxxx" http://pg-sandbox.uni.lu/mine
* Point comments
* URL: `/projects/{projectId}/comments/models/{modelId}/points/{coordinates}`
* Method: GET
* Parameters: TODO
* Parameters:
* `projectId` - identifier of the project
* `modelId` - identifier of the (sub)map in the project or wildcard '*' character
* `coordinates` - coordinates of the point on (sub)map
* `columns` (\*) - set of columns for each result. Possible values are: title, type, content, removed, coord, modelId, elementId, id, pinned, author, email,
* `removed` (\*) - if defined then removed paramter must match.
* Example: TODO
* Create element comment
* URL: `/projects/{projectId}/comments/models/{modelId}/bioEntities/elements/{elementId}`
* Method: POST
* Parameters: TODO
* Parameters:
* `projectId` - identifier of the project
* `modelId` - identifier of the (sub)map in the project
* `elementId` - identifier of the element to be commented
* `name` - name of the author
* `email` - email of the author
* `content` - content of the comment
* `pinned` (\*) - when true comment will be visible for others, if false then nobody except of admin will see it
* `coordinates` - coordinates where comment is placed
* Example:
```
curl -X POST --cookie "MINERVA_AUTH_TOKEN=xxxxxxxx" --data "name=testComment&email=a@a.pl&content=someCont&coordinates=1,2" http://pg-sandbox.uni.lu/minerva/api/projects/pdmap_dec15/comments/models/15305/bioEntities/elements/431868/
@@ -213,7 +269,15 @@ curl -X POST --cookie "MINERVA_AUTH_TOKEN=xxxxxxxx" --data "name=testComment&ema
* Create reaction comment
* URL: `/projects/{projectId}/comments/models/{modelId}/bioEntities/reactions/{reactionId}`
* Method: POST
* Parameters: TODO
* Parameters:
* `projectId` - identifier of the project
* `modelId` - identifier of the (sub)map in the project
* `reactionId` - identifier of the reaction
* `name` - name of the author
* `email` - email of the author
* `content` - content of the comment
* `pinned` (\*) - when true comment will be visible for others, if false then nobody except of admin will see it
* `coordinates` - coordinates where comment is placed
* Example:
```
curl -X POST --cookie "MINERVA_AUTH_TOKEN=xxxxxxxx" --data "name=testComment&email=a@a.pl&content=someCont&coordinates=1,2" http://pg-sandbox.uni.lu/minerva/api/projects/pdmap_dec15/comments/models/15305/bioEntities/reactions/187811
@@ -223,7 +287,14 @@ curl -X POST --cookie "MINERVA_AUTH_TOKEN=xxxxxxxx" --data "name=testComment&ema
* Create coordinates comment
* URL: `/projects/{projectId}/comments/models/{modelId}/points/{coordinates}`
* Method: GET
* Parameters: TODO
* Parameters:
* `projectId` - identifier of the project
* `modelId` - identifier of the (sub)map in the project
* `name` - name of the author
* `email` - email of the author
* `content` - content of the comment
* `pinned` (\*) - when true comment will be visible for others, if false then nobody except of admin will see it
* `coordinates` - coordinates where comment is placed
* Example:
```
curl -X POST --cookie "MINERVA_AUTH_TOKEN=xxxxxxxx" --data "name=testComment&email=a@a.pl&content=someCont" http://pg-sandbox.uni.lu/minerva/api/projects/pdmap_dec15/comments/models/15305/points/1.00,2.00
@@ -232,7 +303,11 @@ curl -X POST --cookie "MINERVA_AUTH_TOKEN=xxxxxxxx" --data "name=testComment&ema
#### Drugs
* URL: `/projects/{projectId}/drugs:search`
* Method: GET
* Parameters: TODO
* Parameters:
* `projectId` - identifier of the project
* `columns` (\*) - set of columns for each result. Possible values are: name, references, description, bloodBrainBarrier, brandNames, synonyms, id, targets,
* `query` (\*) - drug name or synonym
* `target` (\*) - target for which we are lookig for drugs. Target is defined as TYPE:ID. For example "ALIAS:534" is searching for drugs that target Alias with id=534.
* Example:
```
curl -X GET --cookie "MINERVA_AUTH_TOKEN=xxxxxxxx" http://pg-sandbox.uni.lu/minerva/api/projects/pdmap_dec15/drugs:search?query=aspirin
@@ -242,7 +317,11 @@ curl -X GET --cookie "MINERVA_AUTH_TOKEN=xxxxxxxx" http://pg-sandbox.uni.lu/mine
* URL: `/projects/{projectId}/miRnas:search`
* Method: GET
* Parameters: TODO
* Parameters:
* `projectId` - identifier of the project
* `columns` (\*) - set of columns for each result. Possible values are: name, id, targets,
* `query` (\*) - mirna id
* `target` (\*) - target for which we are lookig for drugs. Target is defined as TYPE:ID. For example "ALIAS:534" is searching for drugs that target Alias with id=534.
* Example:
```
curl -X GET --cookie "MINERVA_AUTH_TOKEN=xxxxxxxx" http://pg-sandbox.uni.lu/minerva/api/projects/pdmap_dec15/miRnas:search?query=hsa-miR-125a-3p
@@ -253,7 +332,12 @@ curl -X GET --cookie "MINERVA_AUTH_TOKEN=xxxxxxxx" http://pg-sandbox.uni.lu/mine
* URL: `/projects/{projectId}/models/{modelId}/publications/`
* Method: GET
* Parameters: TODO
* Parameters:
* `projectId` - identifier of the project
* `modelId` - identifier of the (sub)map in the project or wildcard '*' character
* `start` (\*) - first element to be return when pagination is on (default 0)
* `length` (\*) - how many publication we want to retrieve (default 10)
* Example:
```
curl -X GET --cookie "MINERVA_AUTH_TOKEN=xxxxxxxx" http://pg-sandbox.uni.lu/minerva/api/projects/pdmap_dec15/models/*/publications/
@@ -263,7 +347,8 @@ curl -X GET --cookie "MINERVA_AUTH_TOKEN=xxxxxxxx" http://pg-sandbox.uni.lu/mine
* List user data overlays
* URL: `/projects/{projectId}/overlays/`
* Method: GET
* Parameters: TODO
* Parameters:
* `projectId` - identifier of the project
* Example:
```
curl -X GET --cookie "MINERVA_AUTH_TOKEN=xxxxxxxx" http://pg-sandbox.uni.lu/minerva/api/projects/pdmap_dec15/overlays/
@@ -273,10 +358,11 @@ curl -X GET --cookie "MINERVA_AUTH_TOKEN=xxxxxxxx" http://pg-sandbox.uni.lu/mine
* URL: `/projects/{projectId}/overlays/`
* Method: POST
* Parameters:
* name - name of the data overlay
* content - content of the file that is uploaded with definition what should be visible where
* description - short desription of the data overlay
* filename - name of the file that should be used when downloading the source
* `projectId` - identifier of the project
* `name` - name of the data overlay
* `content` - content of the file that is uploaded with definition what should be visible where
* `description` - short desription of the data overlay
* `filename` - name of the file that should be used when downloading the source
* Example:
```
curl -X POST --data "content=name%09color%0ACAPN1%09%2300FF00%0APARK7%09%23AC0000&description=test%20desc&filename=test.txt&name=test%20nam" --cookie "MINERVA_AUTH_TOKEN=xxxxxxxx" http://pg-sandbox.uni.lu/minerva/api/projects/pdmap_dec15/overlays/
@@ -285,17 +371,29 @@ curl -X POST --data "content=name%09color%0ACAPN1%09%2300FF00%0APARK7%09%23AC000
* Update overlay
* URL: `/projects/{projectId}/overlays/{overlayId}/`
* Method: PATCH
* Parameters: TODO
* Parameters:
* `projectId` - identifier of the project
* `overlayId` - identifier of data overlay
* Body: json with updated overlay
```
{
"overlay": {
"name" : name,
"description" : description
}
}
```
* Example:
```
curl -X PATCH --data "{\"overlay\":{\"name\":\"test\", \"description\":\"test2\"}}" --cookie "MINERVA_AUTH_TOKEN=xxxxxxxx" http://pg-sandbox.uni.lu/minerva/api/projects/pdmap_dec15/overlays/3203/
```
* Remove overlay
* URL: `/projects/{projectId}/overlays/{overlayId}/`
* Method: DELETE
* Parameters: TODO
* Parameters:
* `projectId` - identifier of the project
* `overlayId` - identifier of data overlay
* Example:
```
curl -X DELETE --cookie "MINERVA_AUTH_TOKEN=xxxxxxxx" http://pg-sandbox.uni.lu/minerva/api/projects/pdmap_dec15/overlays/3203/
@@ -304,7 +402,9 @@ curl -X DELETE --cookie "MINERVA_AUTH_TOKEN=xxxxxxxx" http://pg-sandbox.uni.lu/m
* Download source
* URL: `/projects/{projectId}/overlays/{overlayId}:downloadSource`
* Method: GET
* Parameters: TODO
* Parameters:
* `projectId` - identifier of the project
* `overlayId` - identifier of data overlay
* Example:
```
curl -X GET --cookie "MINERVA_AUTH_TOKEN=xxxxxxxx" http://pg-sandbox.uni.lu/minerva/api/projects/pdmap_dec15/overlays/3203:downloadSource
@@ -313,7 +413,9 @@ curl -X GET --cookie "MINERVA_AUTH_TOKEN=xxxxxxxx" http://pg-sandbox.uni.lu/mine
* Data overlay details
* URL: `/projects/{projectId}/overlays/{overlayId}/`
* Method: GET
* Parameters: TODO
* Parameters:
* `projectId` - identifier of the project
* `overlayId` - identifier of data overlay
* Example:
```
curl -X GET --cookie "MINERVA_AUTH_TOKEN=xxxxxxxx" http://pg-sandbox.uni.lu/minerva/api/projects/pdmap_dec15/overlays/3203/
@@ -322,7 +424,9 @@ curl -X GET --cookie "MINERVA_AUTH_TOKEN=xxxxxxxx" http://pg-sandbox.uni.lu/mine
* bioEntities (Elements and reactions)
* URL: `/projects/{projectId}/overlays/{overlayId}/models/{modelId}/bioEntities/`
* Method: GET
* Parameters: TODO
* Parameters:
* `projectId` - identifier of the project
* `overlayId` - identifier of data overlay
* Example:
```
curl -X GET --cookie "MINERVA_AUTH_TOKEN=xxxxxxxx" http://pg-sandbox.uni.lu/minerva/api/projects/pdmap_dec15/overlays/3203/models/*/bioEntities/
@@ -331,7 +435,11 @@ curl -X GET --cookie "MINERVA_AUTH_TOKEN=xxxxxxxx" http://pg-sandbox.uni.lu/mine
* Reaction
* URL: `/projects/{projectId}/overlays/{overlayId}/models/{modelId}/bioEntities/reactions/{reactionId}/`
* Method: GET
* Parameters: TODO
* Parameters:
* `projectId` - identifier of the project
* `modelId` - identifier of the (sub)map in the project
* `overlayId` - identifier of data overlay
* `reactionId` - identifier of the reaction
* Example:
```
curl -X GET --cookie "MINERVA_AUTH_TOKEN=xxxxxxxx" http://pg-sandbox.uni.lu/minerva/api/projects/pdmap_dec15/overlays/3203/models/15305/bioEntities/reactions/187811/
@@ -340,26 +448,28 @@ curl -X GET --cookie "MINERVA_AUTH_TOKEN=xxxxxxxx" http://pg-sandbox.uni.lu/mine
* Element
* URL: `/projects/{projectId}/overlays/{overlayId}/models/{modelId}/bioEntities/elements/{elementId}/`
* Method: GET
* Parameters: TODO
* Parameters:
* `projectId` - identifier of the project
* `modelId` - identifier of the (sub)map in the project
* `overlayId` - identifier of data overlay
* `elementId` - identifier of the element
* Example:
```
curl -X GET --cookie "MINERVA_AUTH_TOKEN=xxxxxxxx" http://pg-sandbox.uni.lu/minerva/api/projects/pdmap_dec15/overlays/3203/models/15305/bioEntities/elements/431433/
```
### Users
* User data
* URL: `/users/{login}/`
* Method: GET
* Parameters: TODO
* Parameters:
* `login` - user login
* Example:
```
curl -X GET --cookie "MINERVA_AUTH_TOKEN=xxxxxxxx" http://pg-sandbox.uni.lu/minerva/api/users/testAdmin
```
# JavaScript API (version 11). Unstable dev API.
# JavaScript API. Unstable dev API.
Minerva visualization is created by including `minerva.js` and calling `minerva.create({element:divElement})` method. This method returns a Promise which will resolve to the object that allows custom JS manipulation.
@@ -367,7 +477,7 @@ Minerva visualization is created by including `minerva.js` and calling `minerva.
* `getVisibleDataOverlays()`
* Description: Returns a Promise with list of visible overlays
* Arguments: NONE
* Arguments: *NONE*
* Example:
```
customMap.getVisibleDataOverlays().then(function(overlays){console.log(overlays);});
Loading