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:
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:
-
GraphStoreQueryfunctions for querying transcripts/annotations. -
GraphStorefunctions for editing transcripts/annotations -
GraphStoreAdministrationfunctions 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/)
-
Interface Summary Interface Description APIRequestContext An object that can answer questions about the context of a request, for example the user, configuration parameters, etc. -
Class Summary Class Description APIRequestHandler Base class for request enpoints, which implents common functionality.Attributes /api/attributes : Exports selected attributes for specified transcripts to CSV.Categories /api/categories/class_id[/category] : Listing of category records.Corpus /api/corpus/{ID} : statistics about a given corpus.Dashboard /api/dashboard : Access to dashboard items.Files /api/files : Exports media/transcript files for specified transcripts.KeepAlive /keepalive or /api/keepalive : Keeps the current session/task alive.Password /api/password : change the current user's password.Praat /api/praat : Processes a given set of audio intervals with Praat.RequestParameters A map of request parameter names to their values.Results /api/results : Provides access to search results.Search /api/search : Starts a search task to identify matches for the given search matrix.Store Endpoints starting /api/store/… provide an HTTP-based API for access to GraphStore functions.SystemAttributes /api/systemattributes/name : Access to system attributes.TableServletBase Base class that handles generic database table management.Task /api/task[/{ID}] : information about currently running tasks.User /api/user : information about the current user.Utterances /api/utterances : Starts a task to identify targeted utterances for given participants.Versions /api/versions : version information about LaBB-CAT, its modules, and 3rd-party integrations. -
Annotation Types Summary Annotation Type Description RequiredRole Annotation for aAPIRequestHandlersubclass which defines the user role required to make requests to the servlet.