Package nzilbb.labbcat.server.api

/api/… : API endpoints providing an HTTP-based API for access to transcripts, annotations, media, and functions that manipulate them.

NB there are SDKs for accessing this API:

Java
nzilbb.labbcat
JavaScript
@nzilbb/labbcat
Python
nzilbb-labbcat
R
nzilbb.labbcat

All LaBB-CAT requests for which the the Accept HTTP header is set to application/json return a JSON response with the same standard envelope structure:

title
(string) The title of the LaBB-CAT instance.
version
(string) The version of the LaBB-CAT instance
code
(int) 0 if the request was successful, 1 if there was a problem
messages
An array of message strings.
errors
An array of error message strings.
model
The result of the request, which may be a JSON object, JSON array, or a simple type.

e.g. the response to http://localhost:8080/labbcat/api/store/getLayer?id=word might be:

{
    "title":"LaBB-CAT",
    "version":"20200129.1901",
    "code":0,
    "errors":[],
    "messages":[],
    "model":{
        "id":"word",
        "parentId":"turns",
        "description":"Word tokens",
        "alignment":2,
        "peers":true,
        "peersOverlap":false,
        "parentIncludes":true,
        "saturated":false,
        "type":"string",
        "validLabels":{},
        "category":null
    }
}

If the Accept-Language request header is set, the server will endeavor to localize messages to the specified language.

User authorization for password-protected instances of LaBB-CAT uses the 'Basic' HTTP authentication scheme. This involves sending an Authorization request header of the form Basic TTTTTTTT, where TTTTTTTT is an authentication token formed by base64-encoding a string of the form username:password

Annotation Graph store functions include:

  • GraphStoreQuery functions for querying transcripts/annotations.
  • GraphStore functions for editing transcripts/annotations
  • GraphStoreAdministration functions for defining the data schema, annotation automation, etc.
  • and other LaBB-CAT-specific functions which listed below …

(These class implementations are decoupled from any HTTP request/response object model. HTTP transaction details are currently implemented by JSP files in src/main/jsp/)