Skip to content

Service: Virtual Corpus List

Eliza Margaretha Illig edited this page Oct 25, 2024 · 24 revisions

** WARNING: This service is experimental and may change without any notice.

Lists all virtual corpora (VC) available to the authenticated user including PRIVATE VC created by the user, SYSTEM VC defined by system-admins, and PROJECT VC available to user-groups, wherein the user is a member of. The list can be filtered to show only SYSTEM VC or VC owned by the user.

This web-service requires OAuth2 access token with scope: vc_info.

Available in: full version

Method: GET

Service URL: root/vc

Parameters

Header Parameter

Name Required Authentication scheme Value
Authorization yes HTTP authentication with scheme: Bearer OAuth2 access token with scope: vc_info

Query Parameter

Name Required Description Value
filter-by no Filters the virtual corpus available to the authenticated user.
system only shows corpora created by system.
own only shows corpora created by the authenticated user.
empty (default) shows all corpora available to the authenticated user.
emtpy (default)
system
own

Response Codes

HTTP Status Code Description
200 OK successful request
400 Bad Request when fieldName is null
401 Unauthorized when the operation is not permitted, e.g. user is not a system-admin.
415 Unsupported Media Type when content-type is not specified or incorrect

Examples

Request: Listing all available virtual corpora for the authenticated user (dory)

curl -H 'Authorization: Bearer eyJhbGciOiJIUzI1NiJ9.eyJleHAiOjE1MTM1MzI3O' 
      http://localhost:8089/api/v1.0/vc

Response example

[
    {
        "id": 1,
        "name": "dory-vc",
        "type": "private",
        "status": "experimental",
        "description": "test vc",
        "requiredAccess": "FREE",
        "createdBy": "dory"        
    },
    {
        "id": 2,
        "name": "group-vc",
        "type": "project",
        "status": "experimental",
        "description": "test vc",
        "requiredAccess": "PUB",
        "createdBy": "dory"        
    },
    {
        "id": 3,
        "name": "system-vc",
        "type": "system",
        "status": "experimental",
        "description": "test vc",
        "requiredAccess": "ALL",
        "createdBy": "system"
    }
]

Request: Filtering list to show owned virtual corpora only

curl -H 'Authorization: Bearer eyJhbGciOiJIUzI1NiJ9.eyJleHAiOjE1MTM1MzI3O' 
      http://localhost:8089/api/v1.0/vc?filter-by=own

Response example

[
    {
        "id": 1,
        "name": "dory-vc",
        "type": "private",
        "status": "experimental",
        "description": "test vc",
        "requiredAccess": "FREE",
        "createdBy": "dory"
    },
    {
        "id": 2,
        "name": "group-vc",
        "type": "project",
        "status": "experimental",
        "description": "test vc",
        "requiredAccess": "PUB",
        "createdBy": "dory"
    }
]

Request: Filtering list to show system virtual corpora only

curl -H 'Authorization: Bearer eyJhbGciOiJIUzI1NiJ9.eyJleHAiOjE1MTM1MzI3O' 
      http://localhost:8089/api/v1.0/vc?filter-by=system

Respone example

[
   {
        "id": 3,
        "name": "system-vc",
        "type": "system",
        "status": "experimental",
        "description": "test vc",
        "requiredAccess": "ALL",
        "createdBy": "system"
    }
]
Clone this wiki locally