1. Authentication

1.1. Login

Login to the system.

1.1.1. CURL sample

$ curl 'http://dapi.lcsb.uni.lu/api/doLogin' -i -X POST \
    -H 'Content-Type: application/x-www-form-urlencoded' \
    -d 'login=user&password=passwd'

1.1.2. Request Parameters

Parameter Description

login

login

password

password

1.1.3. Response Fields

Path Type Description

info

String

status message

login

String

user login

token

String

session token

1.1.4. Sample Request

POST /api/doLogin HTTP/1.1
Content-Type: application/x-www-form-urlencoded
Host: dapi.lcsb.uni.lu
Content-Length: 26

login=user&password=passwd

1.1.5. Sample Response

HTTP/1.1 200 OK
Content-Type: application/json
X-Content-Type-Options: nosniff
X-XSS-Protection: 1; mode=block
Cache-Control: no-cache, no-store, max-age=0, must-revalidate
Pragma: no-cache
Expires: 0
X-Frame-Options: DENY
Content-Length: 56

{"info":"Login successful.","login":"user","token":"48"}

1.2. Logout

Logout from the system (invalidate session).

1.2.1. CURL sample

$ curl 'http://dapi.lcsb.uni.lu/api/doLogout' -i -X POST

1.2.2. Response Fields

Path Type Description

status

String

status message

1.2.3. Sample Request

POST /api/doLogout HTTP/1.1
Host: dapi.lcsb.uni.lu

1.2.4. Sample Response

HTTP/1.1 200 OK
Set-Cookie: DAPI_TOKEN=; Path=/; Max-Age=0; Expires=Thu, 1 Jan 1970 00:00:00 GMT
Content-Type: application/json;charset=UTF-8
X-Content-Type-Options: nosniff
X-XSS-Protection: 1; mode=block
Cache-Control: no-cache, no-store, max-age=0, must-revalidate
Pragma: no-cache
Expires: 0
X-Frame-Options: DENY
Content-Length: 15

{"status":"OK"}

1.3. Is authenticated

Check if user in the current session is authenticated. Returns 403 (FORBIDDEN) if the user is not.

1.3.1. CURL sample

$ curl 'http://dapi.lcsb.uni.lu/isAuthenticated' -i -X GET

2. Configuration

2.1. Get

Obtains parameters of the DAPI instance.

2.1.1. CURL sample

$ curl 'http://dapi.lcsb.uni.lu/api/configuration/' -i -X GET

2.1.2. Response Fields

Path Type Description

commitId

String

git commit hash that was used when building DAPI

buildTime

String

when DAPI was built

buildVersion

String

DAPI version

dirty

String

was the build dirty (there were uncommited changes during build process)

2.1.3. Sample Request

GET /api/configuration/ HTTP/1.1
Host: dapi.lcsb.uni.lu

2.1.4. Sample Response

HTTP/1.1 200 OK
Content-Type: application/json;charset=UTF-8
X-Content-Type-Options: nosniff
X-XSS-Protection: 1; mode=block
Cache-Control: no-cache, no-store, max-age=0, must-revalidate
Pragma: no-cache
Expires: 0
X-Frame-Options: DENY
Content-Length: 160

{
  "commitId" : "5eacef75bd22e2b33b223a7898f8c423a4fa0c86",
  "buildTime" : "2025-01-23T07:49:17+0000",
  "buildVersion" : "1.0.0-devel",
  "dirty" : "false"
}

3. Drug

3.1. Get by id

Obtains chemical data from database.

3.1.1. CURL sample

$ curl 'http://dapi.lcsb.uni.lu/api/database/DrugBank/releases/test-release/drugs/DB00006' -i -X GET

3.1.2. Path Parameters

Table 1. /api/database/{database}/releases/{version}/drugs/{drugId}
Parameter Description

database

database name

version

release version of the database

drugId

identifier of the chemical in the database

3.1.3. Response Fields

Path Type Description

name

String

chemical name

description

String

chemical description

synonyms

Array

list of synonyms

sourceIdentifier

String

identifier referencing the entry in source database

annotations

Array

list of annotations of the entry in identifiers.org format

targets

Array<Target>

list of drug targets

targets[].name

String

target name

targets[].description

String

description

targets[].organism

String

organism id

targets[].sourceIdentifier

String

identifier referenceing the entry in source database

targets[].associatedDisease

String

disease id associated with the chemical-target interaction

targets[].identifiers

Array<String>

miriam uris identifying the target

targets[].references

Array<String>

list of miriam uris identifying publications about the target

targets[].types

Array<String>

list of types describing the chemical-target interaction

bloodBrainBarrier

Boolean

blood brain barrier

approved

Boolean

is the drug approved

brandNames

Array<String>

brand names

3.1.4. Sample Request

GET /api/database/DrugBank/releases/test-release/drugs/DB00006 HTTP/1.1
Host: dapi.lcsb.uni.lu

3.1.5. Sample Response

HTTP/1.1 200 OK
Content-Type: application/json;charset=UTF-8
X-Content-Type-Options: nosniff
X-XSS-Protection: 1; mode=block
Cache-Control: no-cache, no-store, max-age=0, must-revalidate
Pragma: no-cache
Expires: 0
X-Frame-Options: DENY
Content-Length: 1128

{
  "name" : "Bivalirudin",
  "description" : "Bivalirudin is a synthetic 20 residue peptide (thrombin inhibitor) which reversibly inhibits thrombin. Once bound to the active site, thrombin cannot activate fibrinogen into fibrin, the crucial step in the formation of thrombus. It is administered intravenously. Because it can cause blood stagnation, it is important to monitor changes in hematocrit, activated partial thromboplastin time, international normalized ratio and blood pressure.",
  "synonyms" : [ "Bivalirudinum", "Bivalirudin", "Hirulog", "Bivalirudina" ],
  "sourceIdentifier" : "drugbank:DB00006",
  "annotations" : [ ],
  "targets" : [ {
    "name" : "Prothrombin",
    "description" : null,
    "organism" : "taxonomy:9606",
    "sourceIdentifier" : "drugbankv4.target:BE0000048",
    "associatedDisease" : null,
    "identifiers" : [ "uniprot:P00734" ],
    "references" : [ "pubmed:11060732", "pubmed:11929334", "pubmed:11923794", "pubmed:11504570", "pubmed:11752352", "pubmed:11833835" ],
    "types" : [ "inhibitor" ]
  } ],
  "bloodBrainBarrier" : null,
  "approved" : null,
  "brandNames" : [ "Angiox" ]
}

3.2. Get all

Obtains list of all chemicals from database. List is paginated and can be filtered.

3.2.1. CURL sample with pagination

$ curl 'http://dapi.lcsb.uni.lu/api/database/DrugBank/releases/test-release/drugs/?size=1' -i -X GET

3.2.2. CURL sample with filtering by target id

$ curl 'http://dapi.lcsb.uni.lu/api/database/DrugBank/releases/test-release/drugs/?target_identifier=urn:miriam:uniprot:P30968' -i -X GET

3.2.3. CURL sample with filtering by target disease

$ curl 'http://dapi.lcsb.uni.lu/api/database/CTD/releases/test-release/drugs/?target_identifier=hgnc.symbol:MYC' -i -X GET

3.2.4. Path Parameters

Table 2. /api/database/{database}/releases/{version}/drugs/
Parameter Description

database

database name

version

release version of the database

3.2.5. Request parameters

Parameter Description

size

page size

number

page number

name

drug name (case insensitive)

synonym

synonym (case insensitive)

target_identifier

target identifier in identifiers.org format (for example: 'uniprot:P30968')

target_disease_identifier

target disease identifier in identifiers.org format (for example: 'mesh:D000230')

3.2.6. Response Parameters

Path Type Description

content

Array<Drug>

list of drugs in the system following search criteria

totalPages

Number

how many pages are available

totalElements

Number

how many drugs are in the database

numberOfElements

Number

how many drugs are in the result list

number

Number

page number

size

Number

size of the page

3.2.7. Sample Response

HTTP/1.1 200 OK
Content-Type: application/json;charset=UTF-8
X-Content-Type-Options: nosniff
X-XSS-Protection: 1; mode=block
Cache-Control: no-cache, no-store, max-age=0, must-revalidate
Pragma: no-cache
Expires: 0
X-Frame-Options: DENY
Content-Length: 1287

{
  "content" : [ {
    "name" : "Bivalirudin",
    "description" : "Bivalirudin is a synthetic 20 residue peptide (thrombin inhibitor) which reversibly inhibits thrombin. Once bound to the active site, thrombin cannot activate fibrinogen into fibrin, the crucial step in the formation of thrombus. It is administered intravenously. Because it can cause blood stagnation, it is important to monitor changes in hematocrit, activated partial thromboplastin time, international normalized ratio and blood pressure.",
    "synonyms" : [ "Bivalirudinum", "Bivalirudin", "Hirulog", "Bivalirudina" ],
    "sourceIdentifier" : "drugbank:DB00006",
    "annotations" : [ ],
    "targets" : [ {
      "name" : "Prothrombin",
      "description" : null,
      "organism" : "taxonomy:9606",
      "sourceIdentifier" : "drugbankv4.target:BE0000048",
      "associatedDisease" : null,
      "identifiers" : [ "uniprot:P00734" ],
      "references" : [ "pubmed:11060732", "pubmed:11929334", "pubmed:11923794", "pubmed:11504570", "pubmed:11752352", "pubmed:11833835" ],
      "types" : [ "inhibitor" ]
    } ],
    "bloodBrainBarrier" : null,
    "approved" : null,
    "brandNames" : [ "Angiox" ]
  } ],
  "totalPages" : 3,
  "totalElements" : 3,
  "numberOfElements" : 1,
  "size" : 1,
  "number" : 0
}

4. Database

4.1. List all

Obtains list of all databases supported by DAPI. List is paginated.

4.1.1. CURL sample

$ curl 'http://dapi.lcsb.uni.lu/api/database/' -i -X GET

4.1.2. Response Fields

Path Type Description

content

Array<ExternalDatabase>

list of databases in the system following search criteria

totalPages

Number

how many pages are available

totalElements

Number

how many databases are in the database

numberOfElements

Number

how many databases are in the result list

number

Number

page number

size

Number

size of the page

content[].name

String

database name

4.1.3. Sample Request

GET /api/database/ HTTP/1.1
Host: dapi.lcsb.uni.lu

4.1.4. Sample Response

HTTP/1.1 200 OK
Content-Type: application/json;charset=UTF-8
X-Content-Type-Options: nosniff
X-XSS-Protection: 1; mode=block
Cache-Control: no-cache, no-store, max-age=0, must-revalidate
Pragma: no-cache
Expires: 0
X-Frame-Options: DENY
Content-Length: 177

{
  "content" : [ {
    "name" : "DrugBank"
  }, {
    "name" : "CTD"
  } ],
  "totalPages" : 1,
  "totalElements" : 2,
  "numberOfElements" : 2,
  "size" : 20,
  "number" : 0
}

5. File

Most of the files that will be uploaded/stored in DAPI are big. Therefore file API requires to create File entity first and then upload file content in chunks.

5.1. Create file

Creates file entity with empty content.

5.1.1. CURL sample

$ curl 'http://dapi.lcsb.uni.lu/api/files/' -i -X POST \
    -H 'Content-Type: application/json' \
    -d '{"filename":"test", "length":127}'

5.1.2. Request Fields

Path Type Description

filename

String

name of the file

length

Number

expected size of the file

5.1.3. Response Fields

Path Type Description

id

Number

identifier

filename

String

file name

length

Number

size of the file (in bytes)

5.1.4. Sample Request

POST /api/files/ HTTP/1.1
Content-Type: application/json
Host: dapi.lcsb.uni.lu
Content-Length: 33

{"filename":"test", "length":127}

5.1.5. Sample Response

HTTP/1.1 200 OK
Content-Type: application/json;charset=UTF-8
X-Content-Type-Options: nosniff
X-XSS-Protection: 1; mode=block
Cache-Control: no-cache, no-store, max-age=0, must-revalidate
Pragma: no-cache
Expires: 0
X-Frame-Options: DENY
Content-Length: 55

{
  "id" : 5,
  "filename" : "test",
  "length" : 127
}

5.2. Upload content

Appends data to file content. Data should be passed in request body.

5.2.1. CURL sample

$ curl 'http://dapi.lcsb.uni.lu/api/files/2' -i -X PATCH \
    -d 'file content'

5.2.2. Path Parameters

Table 3. /api/files/{id}
Parameter Description

id

file identifier

5.2.3. Response Fields

Path Type Description

id

Number

identifier

filename

String

file name

length

Number

size of the file (in bytes)

5.2.4. Sample Response

HTTP/1.1 200 OK
Content-Type: application/json;charset=UTF-8
X-Content-Type-Options: nosniff
X-XSS-Protection: 1; mode=block
Cache-Control: no-cache, no-store, max-age=0, must-revalidate
Pragma: no-cache
Expires: 0
X-Frame-Options: DENY
Content-Length: 54

{
  "id" : 2,
  "filename" : "test",
  "length" : 12
}

5.3. Delete file

Deletes file.

5.3.1. CURL sample

$ curl 'http://dapi.lcsb.uni.lu/api/files/6' -i -X DELETE

5.3.2. Path Parameters

Table 4. /api/files/{id}
Parameter Description

id

file id

5.4. List all

Obtains list of all files. List is paginated and can be filtered.

5.4.1. CURL sample

$ curl 'http://dapi.lcsb.uni.lu/api/files/' -i -X GET

5.4.2. Response Fields

Path Type Description

content

Array<UploadedFile>

list of files in the system following search criteria

totalPages

Number

how many pages are available

totalElements

Number

how many files are in the database

numberOfElements

Number

how many files are in the result list

number

Number

page number

size

Number

size of the page

5.4.3. Sample Response

HTTP/1.1 200 OK
Content-Type: application/json;charset=UTF-8
X-Content-Type-Options: nosniff
X-XSS-Protection: 1; mode=block
Cache-Control: no-cache, no-store, max-age=0, must-revalidate
Pragma: no-cache
Expires: 0
X-Frame-Options: DENY
Content-Length: 196

{
  "content" : [ {
    "id" : 1,
    "filename" : "non-existing-file",
    "length" : 0
  } ],
  "totalPages" : 1,
  "totalElements" : 1,
  "numberOfElements" : 1,
  "size" : 20,
  "number" : 0
}

6. License

6.1. Create license

Creates license.

6.1.1. CURL sample

$ curl 'http://dapi.lcsb.uni.lu/api/license/' -i -X POST \
    -H 'Content-Type: application/json' \
    -d '{"url":"https://creativecommons.org/licenses/by-nc/4.0/legalcode", "name":"Creative Commons Attribution-NonCommercial 4.0 International", "content": "Using Creative Commons Public Licenses\nCreative Commons public licenses provide a standard set of terms and conditions that creators and other rights holders may use to share original works of authorship and other material subject to copyright and certain other rights specified in the public license below. The following considerations are for informational purposes only, are not exhaustive, and do not form part of our licenses..."}'

6.1.2. Request Fields

Path Type Description

name

String

name

url

String

url where the license is located

content

String

text of the license

6.1.3. Response Fields

Path Type Description

name

String

name

url

String

url where the license is located

content

String

text of the license

id

Number

license identifier

6.1.4. Sample Response

HTTP/1.1 200 OK
Content-Type: application/json;charset=UTF-8
X-Content-Type-Options: nosniff
X-XSS-Protection: 1; mode=block
Cache-Control: no-cache, no-store, max-age=0, must-revalidate
Pragma: no-cache
Expires: 0
X-Frame-Options: DENY
Content-Length: 611

{
  "id" : 5,
  "name" : "Creative Commons Attribution-NonCommercial 4.0 International",
  "content" : "Using Creative Commons Public Licenses\nCreative Commons public licenses provide a standard set of terms and conditions that creators and other rights holders may use to share original works of authorship and other material subject to copyright and certain other rights specified in the public license below. The following considerations are for informational purposes only, are not exhaustive, and do not form part of our licenses...",
  "url" : "https://creativecommons.org/licenses/by-nc/4.0/legalcode"
}

6.2. Delete license

Deletes license.

6.2.1. CURL sample

$ curl 'http://dapi.lcsb.uni.lu/api/license/7' -i -X DELETE

6.2.2. Path Parameters

Table 5. /api/license/{license}
Parameter Description

license

license id

6.2.3. Sample Response

HTTP/1.1 200 OK
X-Content-Type-Options: nosniff
X-XSS-Protection: 1; mode=block
Cache-Control: no-cache, no-store, max-age=0, must-revalidate
Pragma: no-cache
Expires: 0
X-Frame-Options: DENY

6.3. Get all

Obtains list of all licenses. List is paginated.

6.3.1. CURL sample

$ curl 'http://dapi.lcsb.uni.lu/api/license/' -i -X GET

6.3.2. Response Fields

Path Type Description

content

Array<License>

list of licenses in the system following search criteria

totalPages

Number

how many pages are available

totalElements

Number

how many licenses are in the database

numberOfElements

Number

how many licenses are in the result list

number

Number

page number

size

Number

size of the page

content[].name

String

name

content[].url

String

url where the license is located

content[].content

String

text of the license

content[].id

Number

license identifier

6.3.3. Sample Response

HTTP/1.1 200 OK
Content-Type: application/json;charset=UTF-8
X-Content-Type-Options: nosniff
X-XSS-Protection: 1; mode=block
Cache-Control: no-cache, no-store, max-age=0, must-revalidate
Pragma: no-cache
Expires: 0
X-Frame-Options: DENY
Content-Length: 815

{
  "content" : [ {
    "id" : 1,
    "name" : "test-name",
    "content" : "test-content",
    "url" : "http://dapi.lcsb.uni.lu/test"
  }, {
    "id" : 3,
    "name" : "fancy name",
    "content" : "Using Creative Commons Public Licenses\nCreative Commons public licenses provide a standard set of terms and conditions that creators and other rights holders may use to share original works of authorship and other material subject to copyright and certain other rights specified in the public license below. The following considerations are for informational purposes only, are not exhaustive, and do not form part of our licenses...",
    "url" : "https://creativecommons.org/licenses/by-nc/4.0/legalcode"
  } ],
  "totalPages" : 1,
  "totalElements" : 2,
  "numberOfElements" : 2,
  "size" : 20,
  "number" : 0
}

7. Release

7.1. Create release

Creates release from uploaded file.

7.1.1. CURL sample

$ curl 'http://dapi.lcsb.uni.lu/api/database/DrugBank/releases/' -i -X POST \
    -H 'Content-Type: application/json' \
    -d '{"file":14, "license":11}'

7.1.2. Path Parameters

Table 6. /api/database/{database}/releases/
Parameter Description

database

database name

7.1.3. Request Fields

Path Type Description

file

Number

id of the file from which release will be created

license

Number

id of the license that is applicable for the release

7.1.4. Response Fields

Path Type Description

id

Number

identifier

name

String

name of the release

timestamp

String

when it was created

license.name

String

name

license.url

String

url where the license is located

license.content

String

text of the license

license.id

Number

license identifier

7.1.5. Sample Request

POST /api/database/DrugBank/releases/ HTTP/1.1
Content-Type: application/json
Host: dapi.lcsb.uni.lu
Content-Length: 25

{"file":14, "license":11}

7.1.6. Sample Response

HTTP/1.1 200 OK
Content-Type: application/json;charset=UTF-8
X-Content-Type-Options: nosniff
X-XSS-Protection: 1; mode=block
Cache-Control: no-cache, no-store, max-age=0, must-revalidate
Pragma: no-cache
Expires: 0
X-Frame-Options: DENY
Content-Length: 161

{
  "id" : 6,
  "name" : "5.1",
  "license" : {
    "id" : 11,
    "name" : "n",
    "content" : "",
    "url" : "u"
  },
  "timestamp" : "12-08-2019 00:00:00"
}

7.2. Accept release license

Accepts release license for user currently logged in.

7.2.1. CURL sample

$ curl 'http://dapi.lcsb.uni.lu/api/database/DrugBank/releases/5.1:acceptLicense' -i -X POST

7.2.2. Path Parameters

Table 7. /api/database/{database}/releases/{release}:acceptLicense
Parameter Description

database

database name

release

release name

7.3. Delete release

7.3.1. CURL sample

$ curl 'http://dapi.lcsb.uni.lu/api/database/DrugBank/releases/5.1' -i -X DELETE

7.3.2. Path Parameters

Table 8. /api/database/{database}/releases/{release}
Parameter Description

database

database name

release

release identifier

7.4. List all

Obtains list of all releases. List is paginated.

7.4.1. CURL sample

$ curl 'http://dapi.lcsb.uni.lu/api/database/DrugBank/releases/' -i -X GET

7.4.2. Path Parameters

Table 9. /api/database/{database}/releases/
Parameter Description

database

database name

7.4.3. Response Fields

Path Type Description

content

Array<Drug>

list of drugs in the system following search criteria

totalPages

Number

how many pages are available

totalElements

Number

how many drugs are in the database

numberOfElements

Number

how many drugs are in the result list

number

Number

page number

size

Number

size of the page

content[].id

Number

identifier

content[].name

String

name of the release

content[].timestamp

String

when it was created

content[].license.name

String

name

content[].license.url

String

url where the license is located

content[].license.content

String

text of the license

content[].license.id

Number

license identifier

7.4.4. Sample Request

GET /api/database/DrugBank/releases/ HTTP/1.1
Host: dapi.lcsb.uni.lu

7.4.5. Sample Response

HTTP/1.1 200 OK
Content-Type: application/json;charset=UTF-8
X-Content-Type-Options: nosniff
X-XSS-Protection: 1; mode=block
Cache-Control: no-cache, no-store, max-age=0, must-revalidate
Pragma: no-cache
Expires: 0
X-Frame-Options: DENY
Content-Length: 546

{
  "content" : [ {
    "id" : 1,
    "name" : "test-release",
    "license" : {
      "id" : 1,
      "name" : "test-name",
      "content" : "test-content",
      "url" : "http://dapi.lcsb.uni.lu/test"
    },
    "timestamp" : "23-01-2025 07:49:40"
  }, {
    "id" : 9,
    "name" : "5.1",
    "license" : {
      "id" : 14,
      "name" : "name",
      "content" : "",
      "url" : "url"
    },
    "timestamp" : "12-08-2019 00:00:00"
  } ],
  "totalPages" : 1,
  "totalElements" : 2,
  "numberOfElements" : 2,
  "size" : 20,
  "number" : 0
}

8. User

8.1. Register user

Registers new user account.

8.1.1. CURL sample

$ curl 'http://dapi.lcsb.uni.lu/api/users/xyz' -i -X POST \
    -H 'Content-Type: application/json' \
    -d '{"login":"xyz","password":"passwd","email":"piotr.gawron@uni.lu"}'

8.1.2. Path Parameters

Table 10. /api/users/{login}
Parameter Description

login

user login

8.1.3. Request Fields

Path Type Description

email

String

user email address

login

String

user login

password

String

user password

8.1.4. Response Fields

Path Type Description

id

Number

identifier of the user

name

String

user name

email

String

user email address

deleted

Boolean

is the user deleted

login

String

user login

enabled

Boolean

is the account enabled

privileges

Array<Privilege>

set of user privileges

privileges[].type

String

type of the privilege

privileges[].objectId

Number

identifier of the object that privilege refer to

acceptedReleaseLicenses

Array<AcceptedReleaseLicense>

set of accepted release licenses

8.1.5. Sample Request

POST /api/users/xyz HTTP/1.1
Content-Type: application/json
Host: dapi.lcsb.uni.lu
Content-Length: 65

{"login":"xyz","password":"passwd","email":"piotr.gawron@uni.lu"}

8.1.6. Sample Response

HTTP/1.1 200 OK
Content-Type: application/json;charset=UTF-8
X-Content-Type-Options: nosniff
X-XSS-Protection: 1; mode=block
Cache-Control: no-cache, no-store, max-age=0, must-revalidate
Pragma: no-cache
Expires: 0
X-Frame-Options: DENY
Content-Length: 185

{
  "id" : 24,
  "name" : null,
  "email" : "piotr.gawron@uni.lu",
  "deleted" : false,
  "login" : "xyz",
  "enabled" : false,
  "privileges" : [ ],
  "acceptedReleaseLicenses" : [ ]
}

8.2. Confirm registration

Confirms account by providing url received by email.

8.2.1. CURL sample

$ curl 'http://dapi.lcsb.uni.lu/registrationConfirm?token=bc04773f-d823-4a1d-8efb-00ffde281d42' -i -X GET

8.2.2. Request parameters

Parameter Description

token

token obtained via email

8.2.3. Response Fields

Path Type Description

id

Number

identifier of the user

name

String

user name

email

String

user email address

deleted

Boolean

is the user deleted

login

String

user login

enabled

Boolean

is the account enabled

privileges

Array<Privilege>

set of user privileges

privileges[].type

String

type of the privilege

privileges[].objectId

Number

identifier of the object that privilege refer to

acceptedReleaseLicenses

Array<AcceptedReleaseLicense>

set of accepted release licenses

8.2.4. Sample Request

GET /registrationConfirm?token=bc04773f-d823-4a1d-8efb-00ffde281d42 HTTP/1.1
Host: dapi.lcsb.uni.lu

8.2.5. Sample Response

HTTP/1.1 200 OK
Content-Type: application/json;charset=UTF-8
X-Content-Type-Options: nosniff
X-XSS-Protection: 1; mode=block
Cache-Control: no-cache, no-store, max-age=0, must-revalidate
Pragma: no-cache
Expires: 0
X-Frame-Options: DENY
Content-Length: 184

{
  "id" : 20,
  "name" : null,
  "email" : "piotr.gawron@uni.lu",
  "deleted" : false,
  "login" : "xyz",
  "enabled" : true,
  "privileges" : [ ],
  "acceptedReleaseLicenses" : [ ]
}

8.3. Get user data

Obtains user data.

8.3.1. CURL sample

$ curl 'http://dapi.lcsb.uni.lu/api/users/user' -i -X GET

8.3.2. Path Parameters

Table 11. /api/users/{login}
Parameter Description

login

user login

8.3.3. Response Fields

Path Type Description

id

Number

identifier of the user

name

String

user name

email

String

user email address

deleted

Boolean

is the user deleted

login

String

user login

enabled

Boolean

is the account enabled

privileges

Array<Privilege>

set of user privileges

privileges[].type

String

type of the privilege

privileges[].objectId

Number

identifier of the object that privilege refer to

acceptedReleaseLicenses

Array<AcceptedReleaseLicense>

set of accepted release licenses

8.3.4. Sample Response

HTTP/1.1 200 OK
Content-Type: application/json;charset=UTF-8
X-Content-Type-Options: nosniff
X-XSS-Protection: 1; mode=block
Cache-Control: no-cache, no-store, max-age=0, must-revalidate
Pragma: no-cache
Expires: 0
X-Frame-Options: DENY
Content-Length: 168

{
  "id" : 29,
  "name" : null,
  "email" : null,
  "deleted" : false,
  "login" : "user",
  "enabled" : true,
  "privileges" : [ ],
  "acceptedReleaseLicenses" : [ ]
}

8.4. List all

Obtains list of all users in the system. List is paginated.

8.4.1. CURL sample

$ curl 'http://dapi.lcsb.uni.lu/api/users/' -i -X GET

8.4.2. Request parameters

Parameter Description

size

page size

number

page number

8.4.3. Response Fields

Path Type Description

content

Array<User>

list of users in the system following search criteria

totalPages

Number

how many pages are available

totalElements

Number

how many users are in the database

numberOfElements

Number

how many users are in the result list

number

Number

page number

size

Number

size of the page

content[].id

Number

identifier of the user

content[].name

String

user name

content[].email

String

user email address

content[].deleted

Boolean

is the user deleted

content[].login

String

user login

content[].enabled

Boolean

is the account enabled

content[].privileges

Array<Privilege>

set of user privileges

content[].privileges[].type

String

type of the privilege

content[].privileges[].objectId

Number

identifier of the object that privilege refer to

content[].acceptedReleaseLicenses

Array<AcceptedReleaseLicense>

set of accepted release licenses

8.4.4. Sample Request

GET /api/users/ HTTP/1.1
Host: dapi.lcsb.uni.lu

8.4.5. Sample Response

HTTP/1.1 200 OK
Content-Type: application/json;charset=UTF-8
X-Content-Type-Options: nosniff
X-XSS-Protection: 1; mode=block
Cache-Control: no-cache, no-store, max-age=0, must-revalidate
Pragma: no-cache
Expires: 0
X-Frame-Options: DENY
Content-Length: 368

{
  "content" : [ {
    "id" : 17,
    "name" : null,
    "email" : null,
    "deleted" : false,
    "login" : "admin",
    "enabled" : true,
    "privileges" : [ {
      "type" : "IS_ADMIN",
      "objectId" : null
    } ],
    "acceptedReleaseLicenses" : [ ]
  } ],
  "totalPages" : 1,
  "totalElements" : 1,
  "numberOfElements" : 1,
  "size" : 20,
  "number" : 0
}

8.5. Grant privilege

Grants user a privilege and returns modified user object.

8.5.1. CURL sample

$ curl 'http://dapi.lcsb.uni.lu/api/users/user:grantPrivilege' -i -X POST \
    -H 'Content-Type: application/json' \
    -d '{"type":"IS_ADMIN","objectId":null}'

8.5.2. Path Parameters

Table 12. /api/users/{login}:grantPrivilege
Parameter Description

login

user login

8.5.3. Request Fields

Path Type Description

type

String

type of the privilege

objectId

Number

identifier of the object that privilege refer to

8.5.4. Response Fields

Path Type Description

id

Number

identifier of the user

name

String

user name

email

String

user email address

deleted

Boolean

is the user deleted

login

String

user login

enabled

Boolean

is the account enabled

privileges

Array<Privilege>

set of user privileges

privileges[].type

String

type of the privilege

privileges[].objectId

Number

identifier of the object that privilege refer to

acceptedReleaseLicenses

Array<AcceptedReleaseLicense>

set of accepted release licenses

8.5.5. Sample Request

POST /api/users/user:grantPrivilege HTTP/1.1
Content-Type: application/json
Host: dapi.lcsb.uni.lu
Content-Length: 35

{"type":"IS_ADMIN","objectId":null}

8.5.6. Sample Response

HTTP/1.1 200 OK
Content-Type: application/json;charset=UTF-8
X-Content-Type-Options: nosniff
X-XSS-Protection: 1; mode=block
Cache-Control: no-cache, no-store, max-age=0, must-revalidate
Pragma: no-cache
Expires: 0
X-Frame-Options: DENY
Content-Length: 221

{
  "id" : 30,
  "name" : null,
  "email" : null,
  "deleted" : false,
  "login" : "user",
  "enabled" : true,
  "privileges" : [ {
    "type" : "IS_ADMIN",
    "objectId" : null
  } ],
  "acceptedReleaseLicenses" : [ ]
}

8.6. Revoke privilege

Revokes user a privilege and returns modified user object.

8.6.1. CURL sample

$ curl 'http://dapi.lcsb.uni.lu/api/users/user:revokePrivilege' -i -X POST \
    -H 'Content-Type: application/json' \
    -d '{"type":"IS_ADMIN","objectId":null}'

8.6.2. Path Parameters

Table 13. /api/users/{login}:revokePrivilege
Parameter Description

login

user login

8.6.3. Request Fields

Path Type Description

type

String

type of the privilege

objectId

Number

identifier of the object that privilege refer to

8.6.4. Response Fields

Path Type Description

id

Number

identifier of the user

name

String

user name

email

String

user email address

deleted

Boolean

is the user deleted

login

String

user login

enabled

Boolean

is the account enabled

privileges

Array<Privilege>

set of user privileges

privileges[].type

String

type of the privilege

privileges[].objectId

Number

identifier of the object that privilege refer to

acceptedReleaseLicenses

Array<AcceptedReleaseLicense>

set of accepted release licenses

8.6.5. Sample Request

POST /api/users/user:revokePrivilege HTTP/1.1
Content-Type: application/json
Host: dapi.lcsb.uni.lu
Content-Length: 35

{"type":"IS_ADMIN","objectId":null}

8.6.6. Sample Response

HTTP/1.1 200 OK
Content-Type: application/json;charset=UTF-8
X-Content-Type-Options: nosniff
X-XSS-Protection: 1; mode=block
Cache-Control: no-cache, no-store, max-age=0, must-revalidate
Pragma: no-cache
Expires: 0
X-Frame-Options: DENY
Content-Length: 215

{
  "id" : 28,
  "name" : null,
  "email" : null,
  "deleted" : false,
  "login" : "user",
  "enabled" : true,
  "privileges" : [ {
    "type" : "READ",
    "objectId" : 13
  } ],
  "acceptedReleaseLicenses" : [ ]
}