Skip to content
This repository was archived by the owner on Jun 7, 2024. It is now read-only.

RESTful webservice

Markus List edited this page Feb 25, 2015 · 2 revisions

In version 1.3, OLF introduces a RESTful webservice that provides full programmatic access to DataObjects found in OpenLabFramework. The RESTfulController that has been implemented to this end will only accept SSL connections that provide a valid token (see AppAccessTokens). The RESTful webservice currently offers two methods. Both return their results in JSON format.

#Search using a query The search method utilized the power of the lucene search to offer a list of DataObjects:

Usage: https://.../restful/search?query=${query}&type=${type}&token=${token}

  • query: required. Lucene compatible search query. Symbols will be escaped.
  • type: optional. If provided, the search will be limited to a specific type of DataObject.
  • token: required. Needs to be created by an administrator first.

Example: https://130.225.157.237//OpenLabFramework/restful/search?query=Hewl&type=gene&token=0750ab92-c412-459d-aee3-d7612d009024

Output:

{
total: 1,
results: [
{
id: 25,
label: "Hewl"
}
],
data: [
{
class: "org.openlab.genetracker.Gene",
id: 25,
accessionNumber: "3.2.1.17",
alternativeSplicing: true,
creator: null,
dateCreated: "2015-01-23T15:25:07Z",
description: "Hen Egg White Lysozyme",
geneType: "Wildtype",
lastModifier: null,
lastUpdate: "2015-01-23T15:25:07Z",
length: 0,
mutation: true,
name: "Hewl",
notes: "N-acetylmuramide glycanhydrolase",
orfStart: 0,
orfStop: 0,
organism: null,
origin: null,
originDescription: null,
projects: [ ],
sequence: ">gi|212274|gb|J00885.1|CHKLSZ4 Chicken egg white lysozyme gene: exon-4 and 3' flank TCTCCCTCCGCCCAGGGTCGCCTGGCGCAACCGCTGCAAGGGCACCGACGTCCAGGCGTGGATCAGAGGC TGCCGGCTGTGAGGAGCTGCCGCACCCGGCCCGCCCGCTGCACAGCCGGCCGCTTTGCGAGCGCGACGCT ACCCGCTTGGCAGTTTTAAACGCATCCCTCATTAAAACGACTATACGCAAACGCCTT",
wildTypeGene: null
}
],
status: "OK"
}

#Get DataObject

Usage: https://.../restful/search?id=${id}&token=${token}

  • id: required. DataObject id
  • token: required.

Example: https://130.225.157.237/OpenLabFramework/restful/get?id=25&token=0750ab92-c412-459d-aee3-d7612d009024

Output:

{
result: {
class: "org.openlab.genetracker.Gene",
id: 25,
accessionNumber: "3.2.1.17",
alternativeSplicing: true,
creator: {
class: "User",
id: 1
},
dateCreated: "2015-01-23T15:25:07Z",
description: "Hen Egg White Lysozyme",
geneType: "Wildtype",
lastModifier: {
class: "User",
id: 1
},
lastUpdate: "2015-01-23T15:25:07Z",
length: 0,
mutation: true,
name: "Hewl",
notes: "N-acetylmuramide glycanhydrolase",
orfStart: 0,
orfStop: 0,
organism: {
class: "Organism",
id: 1
},
origin: null,
originDescription: null,
projects: [ ],
sequence: ">gi|212274|gb|J00885.1|CHKLSZ4 Chicken egg white lysozyme gene: exon-4 and 3' flank TCTCCCTCCGCCCAGGGTCGCCTGGCGCAACCGCTGCAAGGGCACCGACGTCCAGGCGTGGATCAGAGGC TGCCGGCTGTGAGGAGCTGCCGCACCCGGCCCGCCCGCTGCACAGCCGGCCGCTTTGCGAGCGCGACGCT ACCCGCTTGGCAGTTTTAAACGCATCCCTCATTAAAACGACTATACGCAAACGCCTT",
wildTypeGene: null
},
status: "OK"
}

Clone this wiki locally