Generated with https://github.com/ICIJ/fluent-http-apigen
Retrieve the batch search list for the user issuing the request.
Return 200 and the list of batch searches
Example :
Retrieve the batch search list for the user issuing the request filter with the given criteria, and the total of batch searches matching the criteria.
It needs a Query json body with the parameters :
from : index offset of the first document to return (mandatory)
size : window size of the results (mandatory)
sort : field to sort (prj_id name user_id description state batch_date batch_results published) (default "batch_date")
order : "asc" or "desc" (default "asc")
project : projects to include in the filter (default null / empty list)
batchDate : batch search with a creation date included in this range (default null / empty list)
state : states to include in the filter (default null / empty list)
publishState : publish state to filter (default null)
If from/size are not given their default values are 0, meaning that all the results are returned. BatchDate must be a list of 2 items (the first one for the starting date and the second one for the ending date) If defined publishState is a string equals to "0" or "1"
Return 200 and the list of batch searches with the total batch searches for the query. See example for the JSON format.
Example :
Retrieve the batch search with the given id The query param "withQueries" accepts a boolean value When "withQueries" is set to false, the list of queries is empty and nbQueries contains the number of queries.
Parameter batchId
Return 200 and the batch search
Example :
Retrieve the batch search queries with the given batch id and returns a list of strings UTF-8 encoded
if the request parameter format is set with csv, then it will answer with content-disposition attachment (file downloading)
the optional request parameters are :
from: if not provided it starts from 0
size: if not provided all queries are returned from the "from" parameter
search: if provided it will filter the queries accordingly
orderBy: field name to order by asc, "query_number" by default (if it does not exist it will return a 500 error)
maxResult: number of maximum results for each returned query (-1 means no maxResults)
Parameter batchId
Return 200 and the batch search queries map [(query, nbResults), ...]
Example :
preflight request
Return 200 DELETE
preflight resquest for removal of one batchsearch
Parameter batchId
Return 200 DELETE
Delete batch search with the given id and its results. It won't delete running batch searches, because results are added and would be orphans.
Returns 204 (No Content) : idempotent
Return 204
Example :
Update batch search with the given id.
Returns 200 and 404 if there is no batch id If the user issuing the request is not the same as the batch owner in database, it will do nothing (thus returning 404)
Return 200 or 404
Example :
Creates a new batch search. This is a multipart form with 8 fields : name, description, csvFile, published, fileTypes, paths, fuzziness, phrase_matches
No matter the order. The name and csv file are mandatory else it will return 400 (bad request) Csv file must have under 60 000 lines else it will return 413 (payload too large) Queries with less than two characters are filtered
To do so with bash you can create a text file like :
Then replace with with a sed like this:
sed -i 's/$/^M/g' ~/multipart.txt
Then make a curl request with this file :
Parameter comaSeparatedProjects
Parameter context : the request body
Return 200 or 400 or 413
preflight request
Return 200 POST
Create a new batch search based on a previous one given its id, and enqueue it for running
it returns 404 if the source BatchSearch object is not found in the repository.
Parameter sourceBatchId: the id of BatchSearch to copy
Parameter context : the context of request (containing body)
Return 200 or 404
Example:
Retrieve the results of a batch search as JSON.
It needs a Query json body with the parameters :
from : index offset of the first document to return (mandatory)
size : window size of the results (mandatory)
queries: list of queries to be downloaded (default null)
sort: field to sort ("doc_nb", "doc_id", "root_id", "doc_path", "creation_date", "content_type", "content_length", "creation_date") (default "doc_nb")
order: "asc" or "desc" (default "asc")
If from/size are not given their default values are 0, meaning that all the results are returned.
Parameter batchId
Parameter webQuery
Return 200
Example :
Retrieve the results of a batch search as a CSV file.
The search request is by default all results of the batch search.
Parameter batchId
Return 200 and the CSV file as attached file
Example :
Delete batch searches and results for the current user.
Returns 204 (No Content): idempotent
Return 204
Example :
Returns the file from the index with the index id and the root document (if embedded document).
The routing can be omitted if it is a top level document, or it can be the same as the id.
Returns 404 if it doesn't exist
Returns 403 if the user has no access to the requested index.
Parameter project
Parameter id
Parameter routing
Return 200 or 404 or 403 (Forbidden)
Example :
Fetch extracted text by slice (pagination)
Parameter project Project id
Parameter id Document id
Parameter offset Starting byte (starts at 0)
Parameter limit Size of the extracted text slice in bytes
Parameter targetLanguage Target language (like "ENGLISH") to get slice from translated content
Return 200 and a JSON containing the extracted text content ("content":text), the max offset as last rank index ("maxOffset":number), start ("start":number) and size ("size":number) parameters.
Throws IOException
Example :
Search query occurrences in content or translated content (pagination)
Parameter project Project id
Parameter id Document id
Parameter query Query string to search occurrences (starts at 0)
Parameter targetLanguage Target language (like "ENGLISH") to search in translated content
Return 200 and a JSON containing the occurrences offsets in the text, and the count of occurrences.
Throws IOException
Example :
Group star the documents. The id list is passed in the request body as a json list.
It answers 200 if the change has been done and the number of documents updated in the response body.
Parameter projectId
Parameter docIds as json
Return 200 and the number of documents updated
Example :
Group unstar the documents. The id list is passed in the request body as a json list.
It answers 200 if the change has been done and the number of documents updated in the response body.
Parameter projectId
Parameter docIds as json in body
Return 200 and the number of documents unstarred
Example :
Retrieves the list of starred document for a given project.
Parameter projectId
Return 200
Example :
Retrieves the list of tagged document with tag "tag" for the given project id.
This service doesn't need to have the document stored in the database (no join is made)
Parameter projectId
Parameter comaSeparatedTags
Return 200
Example :
preflight request
Parameter projectId
Parameter docId
Return 200 PUT
Parameter projectId
Parameter docId
Parameter routing
Parameter tags
Return 201 if created else 200
Example :
Gets all the tags from a document with the user and timestamp.
Parameter projectId
Parameter docId
Return 200 and the list of tags
Example :
Group tag the documents. The document id list and the tag list are passed in the request body.
It answers 200 if the change has been done.
Parameter projectId
Parameter query
Return 200
Example :
Group untag the documents. The document id list and the tag list are passed in the request body.
It answers 200 if the change has been done.
Parameter projectId
Parameter query
Return 200
Example :
preflight request
Parameter projectId
Parameter docId
Return 200 PUT
Untag one document
Parameter projectId
Parameter docId
Parameter routing
Parameter tags
Return 201 if untagged else 200
Retrieves the list of starred document for all projects.
This service needs to have the document stored in the database.
Return 200 and the list of Documents
Retrieves the list of users who recommended a document with the total count of recommended documents for the given project id
Parameter projectId
Return 200
Example :
Get all users who recommended a document with the count of all recommended documents for project and documents ids.
Parameter projectId
Parameter comaSeparatedDocIds
Return 200 and the list of tags
Example :
Retrieves the set of marked read documents for the given project id and a list of users provided in the url.
This service doesn't need to have the document stored in the database (no join is made)
Parameter projectId
Parameter comaSeparatedUsers
Return 200
Example :
Group mark the documents "read". The id list is passed in the request body as a json list.
It answers 200 if the change has been done and the number of documents updated in the response body.
Parameter projectId
Parameter docIds as json
Return 200 and the number of documents marked
Example :
Group unmark the documents. The id list is passed in the request body as a json list.
It answers 200 if the change has been done and the number of documents updated in the response body.
Parameter projectId
Parameter docIds as json
Return 200 and the number of documents unmarked
Example :
Gets the extension set in JSON
If a request parameter "filter" is provided, the regular expression will be applied to the list.
see https://docs.oracle.com/javase/8/docs/api/java/util/regex/Pattern.html for pattern syntax.
Example:
Return
Preflight request
Return OPTIONS,PUT
Download (if necessary) and install extension specified by its id or url
request parameter id
or url
must be present.
Return 200 if the extension is installed
Return 404 if the extension is not found by the provided id or url
Return 400 if neither id nor url is provided
Throws IOException
Example:
Preflight request
Return OPTIONS,DELETE
Uninstall extension specified by its id
Parameter extensionId
Return 204 if the extension is uninstalled (idempotent)
Throws IOException if there is a filesystem error
Example:
Create the index for the current user if it doesn't exist.
Return 201 (Created) or 200 if it already exists
Example :
Preflight for index creation.
Parameter index
Return 200 with PUT
Head request useful for JS api (for example to test if an index exists)
Parameter path
Return 200
The search endpoint is just a proxy in front of Elasticsearch, everything sent is forwarded to Elasticsearch. DELETE method is not allowed.
Path can be of the form :
_search/scroll
index_name/_search
index_name1,index_name2/_search
index_name/_count
index_name1,index_name2/_count
index_name/doc/_search
index_name1,index_name2/doc/_search
Parameter path
Return 200 or http error from Elasticsearch
Example :
Search GET request to Elasticsearch
As it is a GET method, all paths are accepted.
if a body is provided, the body will be sent to ES as source=urlencoded(body)&source_content_type=application%2Fjson in that case, request parameters are not taken into account.
Parameter path
Return 200 or http error from Elasticsearch
Example :
Prefligth option request
Parameter path
Return 200
Returns the named entity with given id and document id.
Parameter id
Parameter documentId the root document
Return 200
Example :
preflight request for hide
Parameter mentionNorm
Return 200 PUT
hide all named entities with the given normalized mention
Parameter mentionNorm
Parameter project
Return 200
Example :
Get the list of registered pipelines.
Return pipeline set Example:
When datashare is launched in NER mode (without index) it exposes a name finding HTTP API. The text is sent with the HTTP body.
Parameter pipeline to use
Parameter text to analyse in the request body
Return list of NamedEntities annotations
Example :
Gets the list of notes for a project and a document path.
if we have on disk:
And in database
then :
GET /api/p1/notes/a/b/doc1
will return note A and B
GET /api/p1/notes/a/c/doc2
will return note A
GET /api/p1/notes/d/doc3
will return an empty list
If the user doesn't have access to the project she gets a 403 Forbidden
Parameter project the project the note belongs to
Parameter documentPath the document path
Parameter context HTTP context containing the user
Return list of Note that match the document path
Example:
Gets the list of notes for a project.
If the user doesn't have access to the project she gets a 403 Forbidden
Parameter project the project the note belongs to
Parameter context HTTP context containing the user
Return list of Note related to the project
Example:
Gets the plugins set in JSON
If a request parameter "filter" is provided, the regular expression will be applied to the list.
see https://docs.oracle.com/javase/8/docs/api/java/util/regex/Pattern.html for pattern syntax.
Example:
Preflight request
Return OPTIONS,PUT
Download (if necessary) and install plugin specified by its id or url
request parameter id
or url
must be present.
Return 200 if the plugin is installed
Return 404 if the plugin is not found by the provided id or url
Return 400 if neither id nor url is provided
Throws IOException
Throws ArchiveException
Example:
Preflight request
Return OPTIONS,DELETE
Uninstall plugin specified by its id Always returns 204 or error 500.
Parameter pluginId
Return 204
Throws IOException if there is a filesystem error
Example:
Gets the project information for the given project id.
Parameter id
Return 200 and the project from database if it exists
Example :
``` curl -H 'Content-Type:application/json' localhost:8080/api/project/apigen-datashare {"error":"java.lang.NullPointerException"} ``` ) ##Get /api/project/isDownloadAllowed/:id Returns if the project is allowed with this network route : in datashare database there is the project table that can specify an IP mask that is allowed per project. If the client IP is not in the range, then the file download will be forbidden.
in that project table there is a field called allow_from_mask
that can have a mask with IP and star wildcard.
Ex : 192.168.*.*
will match all subnetwork 192.168.0.0 IP's and only users with an IP in this range will be granted for downloading documents.
Parameter id
Return 200 or 403 (Forbidden)
Example :
Example :
Preflight option request
Parameter id
Return 200 DELETE
Delete the project from database and elasticsearch indices.
It always returns 204 (no content) or 500 if an error occurs.
If the project id is not the current user project (local-datashare in local mode), then it will return 401 (unauthorized)
Parameter id
Return 204
Example :
gets the root of the front-end app ie: ./app/index.html
if pluginsDir is set, it will add in the index the tag else it will return the index.html content as is
Return the content of index.html file
Gets the public (i.e. without user's information) datashare settings parameters. These parameters are used for the client app for the init process.
The endpoint is removing all fields that contain Address or Secret or Url or Key
Return 200
Example :
Gets the versions (front/back/docker) of datashare.
Return 200
Example :
Preflight for settings.
Parameter context
Return 200 with PATCH
update the datashare settings with provided body. It will save the settings on disk.
Returns 404 if settings is not found. It means that the settings file has not been set (or is not readable) Returns 403 if we are in SERVER mode
The settings priority is basically DS_DOCKER_* variables > -s file > classpath:datashare.properties > command line. I.e. :
DS_DOCKER_* variables will be taken and override all keys (if any similar keys exist)
if a file is given (w/ -c path/to/file) to the command line it will be read and used (it can be empty or not present)
if no file is given, we are looking for datashare.properties in the classpath (for example in /dist)
if none of the two above cases is fulfilled we are taking the default CLI parameters (and those given by the user)
parameters are common between CLI and settings file, the settings file "wins"
if a settings file is not writable then 404 will be returned (and a WARN will be logged at start)
Return 200 or 404 or 403
Example :
List all available language in Tesseract
Returns 503 if Tesseract is not installed
Return 200 or 503
List all available language in the text extractor
Return 200
Retrieve the status of databus connection, database connection, shared queues and index. Adding "format=openmetrics" parameter to the url will return the status witn openmetrics format.
Return the status of datashare elements
Example:
gets all the user tasks a filter can be added with a pattern contained in the task name.
Return 200 and the list of tasks
Example :
gets one task with its id
Parameter id
Return 200
Example :
gets task result with its id
Parameter id
Return 200 and the result, 204 if there is no result 404 if the tasks doesn't exist 403 if the task is not belonging to current user
Example :
download files from a search query. Expected parameters are :
project: string
query: string or elasticsearch JSON query
if the query is a string it is taken as an ES query string, else it is a raw JSON query (without the query part) @see org.elasticsearch.index.query.WrapperQueryBuilder that is used to wrap the query
Parameter optionsWrapper wrapper for options json
Return 200 and json task
Example :
index files from the queue
Parameter optionsWrapper wrapper for options json
Return 200 and json task
Example :
Indexes files in a directory (with docker, it is the mounted directory that is scanned)
Parameter optionsWrapper
Return 200 and the list of tasks created
Example :
Indexes all files of a directory with the given path.
Parameter filePath
Parameter optionsWrapper
Return 200 and the list of created tasks
Example $(curl -XPOST localhost:8080/api/task/batchUpdate/index/home/dev/myfile.txt)
Scans recursively a directory with the given path
Parameter filePath
Parameter optionsWrapper
Return 200 and the task created
Example :
Cleans all DONE tasks.
Return 200 and the list of removed tasks
Example :
Cleans a specific task.
Parameter taskName
Return
Example :
Cancels the task with the given name. It answers 200 with the cancellation status true|false
Parameter taskId
Return
Cancels the running tasks. It returns a map with task name/stop statuses. If the status is false, it means that the thread has not been stopped.
Return 200 and the tasks stop result map
Example : curl -XPUT localhost:8080/api/task/stopAll
Find names using the given pipeline :
OPENNLP
CORENLP
IXAPIPE
GATENLP
MITIE
This endpoint is going to find all Documents that are not taggued with the given pipeline, and extract named entities for all these documents.
Parameter pipelineName
Parameter optionsWrapper
Return 200 and the list of created tasks
Example :
List all files and directory for the given path. This endpoint returns a JSON using the same specification than the tree
command on UNIX. It is roughly the equivalent of:
Parameter dirPath
Return 200 and the list of files and directory
Example $(curl -XGET localhost:8080/api/tree/home/datashare/data)
Gets the user's session information
Return 200 and the user map
Example :
Preflight for history.
Return 200 with OPTIONS, GET, PUT and DELETE
Gets the user's history by type
Parameter type String included in 'document' or 'search'
Parameter from the offset of the list, starting from 0
Parameter size the number of element retrieved
Parameter sort the name of the parameter to sort on (default: modificationDate)
Parameter desc the list is sorted in descending order (default: true)
Parameter projects projectIds separated by comma to filter by projects (default: none)
Return 200, the user's list of events and the total number of events
Example : ``` curl -i localhost:8080/api/users/me/history?type=document&from=0&size=10&sort=modificationDate&desc=true&projects=project1,project2 HTTP/1.1 200 OK Access-Control-Allow-Origin: * Content-Type: application/json;charset=UTF-8 ETag: 9a3f093e2dc5d929bb25879501d527c7 Content-Length: 22 Connection: keep-alive Set-Cookie: _ds_session_id={"login":null,"roles":null,"sessionId":null,"redirectAfterLogin":"/"}; version=1; path=/; expires=Mon, 30-Jul-2091 14:00:32 GMT; max-age=2147483647
{"items":[],"total":0}
curl -i -XPUT -H "Content-Type: application/json" localhost:8080/api/users/me/history -d '{"type": "SEARCH", "projectIds": ["apigen-datashare","local-datashare"], "name": "foo AND bar", "uri": "?q=foo%20AND%20bar&from=0&size=100&sort=relevance&index=luxleaks&field=all&stamp=cotgpe"}' HTTP/1.1 500 Internal Server Error Content-Type: application/json;charset=UTF-8 ETag: b1b6023e69d8821fc4e1e8418ab85f30 Content-Length: 77 Connection: keep-alive
{"error":"org.jooq.exception.DataAccessException: Cannot commit transaction"}
curl -i -XDELETE localhost:8080/api/users/me/history?type=search HTTP/1.1 500 Internal Server Error Content-Type: application/json;charset=UTF-8 ETag: b1b6023e69d8821fc4e1e8418ab85f30 Content-Length: 77 Connection: keep-alive
{"error":"org.jooq.exception.DataAccessException: Cannot commit transaction"}
curl -i -XDELETE localhost:8080/api/users/me/history/event?id=1 HTTP/1.1 500 Internal Server Error Content-Type: application/json;charset=UTF-8 ETag: b1b6023e69d8821fc4e1e8418ab85f30 Content-Length: 77 Connection: keep-alive
{"error":"org.jooq.exception.DataAccessException: Cannot commit transaction"}
projectId | path | note | variant |
---|---|---|---|
p1
a
note A
info
p1
a/b
note B
danger
api_key
api_key_pkey PRIMARY KEY, btree (id)
api_key_user_id_key UNIQUE CONSTRAINT, btree (user_id)
batch_search
batch_search_pkey PRIMARY KEY, btree (uuid)
batch_search_date btree (batch_date)
batch_search_published btree (published)
batch_search_user_id btree (user_id)
batch_search_pkey PRIMARY KEY, btree (uuid)
batch_search_date btree (batch_date)
batch_search_published btree (published)
batch_search_user_id btree (user_id)
Referenced by:
TABLE batch_search_project CONSTRAINT batch_search_project_batch_search_uuid_fk FOREIGN KEY (search_uuid) REFERENCES batch_search(uuid)
batch_search_project
batch_search_project_unique UNIQUE, btree (search_uuid, prj_id)
batch_search_project_batch_search_uuid_fk FOREIGN KEY (search_uuid) REFERENCES batch_search(uuid)
batch_search_query
idx_query_result_batch_unique UNIQUE, btree (search_uuid, query)
batch_search_query_search_id btree (search_uuid)
batch_search_result
batch_search_result_prj_id btree (prj_id)
batch_search_result_query btree (query)
batch_search_result_uuid btree (search_uuid)
document
document_pkey PRIMARY KEY, btree (id)
document_parent_id btree (parent_id)
document_status btree (status)
document_tag
idx_document_tag_unique UNIQUE, btree (doc_id, label)
document_tag_doc_id btree (doc_id)
document_tag_label btree (label)
document_tag_project_id btree (prj_id)
document_user_recommendation
idx_document_mark_read_unique UNIQUE, btree (doc_id, user_id, prj_id)
document_user_mark_read_doc_id btree (doc_id)
document_user_mark_read_project_id btree (prj_id)
document_user_mark_read_user_id btree (user_id)
document_user_star
idx_document_star_unique UNIQUE, btree (doc_id, user_id, prj_id)
document_user_star_doc_id btree (doc_id)
document_user_star_project_id btree (prj_id)
document_user_star_user_id btree (user_id)
named_entity
named_entity_pkey PRIMARY KEY, btree (id)
named_entity_doc_id btree (doc_id)
note
idx_unique_note_path_project UNIQUE, btree (project_id, path)
note_project btree (project_id)
project
project_pkey PRIMARY KEY, btree (id)
user_history
user_history_pkey PRIMARY KEY, btree (id)
idx_user_history_unique UNIQUE, btree (user_id, uri)
user_history_creation_date btree (creation_date)
user_history_type btree (type)
user_history_user_id btree (user_id)
user_history_pkey PRIMARY KEY, btree (id)
idx_user_history_unique UNIQUE, btree (user_id, uri)
user_history_creation_date btree (creation_date)
user_history_type btree (type)
user_history_user_id btree (user_id)
Referenced by:
TABLE user_history_project CONSTRAINT user_history_project_user_history_id_fk FOREIGN KEY (user_history_id) REFERENCES user_history(id)
user_history_project
user_history_project_unique UNIQUE, btree (user_history_id, prj_id)
user_history_project_user_history_id_fk FOREIGN KEY (user_history_id) REFERENCES user_history(id)
user_inventory
user_inventory_pkey PRIMARY KEY, btree (id)
Column | Type | Nullable | Default |
---|---|---|---|
Column | Type | Nullable | Default |
---|---|---|---|
Column | Type | Nullable | Default |
---|---|---|---|
Column | Type | Nullable | Default |
---|---|---|---|
Column | Type | Nullable | Default |
---|---|---|---|
Column | Type | Nullable | Default |
---|---|---|---|
Column | Type | Nullable | Default |
---|---|---|---|
Column | Type | Nullable | Default |
---|---|---|---|
Column | Type | Nullable | Default |
---|---|---|---|
Column | Type | Nullable | Default |
---|---|---|---|
Column | Type | Nullable | Default |
---|---|---|---|
Column | Type | Nullable | Default |
---|---|---|---|
Column | Type | Nullable | Default |
---|---|---|---|
Column | Type | Nullable | Default |
---|---|---|---|
Column | Type | Nullable | Default |
---|---|---|---|
id
character varying(96)
not null
user_id
character varying(96)
not null
creation_date
timestamp without time zone
not null
uuid
character(36)
not null
name
character varying(255)
description
character varying(4096)
user_id
character varying(96)
not null
batch_date
timestamp without time zone
not null
state
character varying(8)
not null
published
integer
not null
0
phrase_matches
integer
not null
0
fuzziness
integer
not null
0
file_types
text
paths
text
error_message
text
batch_results
integer
0
error_query
text
search_uuid
character(36)
not null
prj_id
character varying(96)
not null
search_uuid
character(36)
not null
query_number
integer
not null
query
text
not null
query_results
integer
0
search_uuid
character(36)
not null
query
text
not null
doc_nb
integer
not null
doc_id
character varying(96)
not null
root_id
character varying(96)
not null
doc_path
character varying(4096)
not null
creation_date
timestamp without time zone
content_type
character varying(255)
content_length
bigint
prj_id
character varying(96)
id
character varying(96)
not null
path
character varying(4096)
not null
project_id
character varying(96)
not null
content
text
metadata
text
status
smallint
extraction_level
smallint
language
character(2)
extraction_date
timestamp without time zone
parent_id
character varying(96)
root_id
character varying(96)
content_type
character varying(256)
content_length
bigint
charset
character varying(32)
ner_mask
smallint
doc_id
character varying(96)
not null
label
character varying(64)
not null
prj_id
character varying(96)
user_id
character varying(255)
creation_date
timestamp without time zone
not null
'1970-01-01 00:00:00'::timestamp without time zone
doc_id
character varying(96)
not null
user_id
character varying(96)
not null
prj_id
character varying(96)
doc_id
character varying(96)
not null
user_id
character varying(96)
not null
prj_id
character varying(96)
id
character varying(96)
not null
mention
text
not null
offsets
text
not null
extractor
smallint
not null
category
character varying(8)
doc_id
character varying(96)
not null
root_id
character varying(96)
extractor_language
character(2)
hidden
boolean
project_id
character varying(96)
not null
path
character varying(4096)
note
text
variant
character varying(16)
id
character varying(255)
not null
path
character varying(4096)
allow_from_mask
character varying(64)
label
character varying(255)
publisher_name
character varying(255)
''::character varying
maintainer_name
character varying(255)
''::character varying
source_url
character varying(2048)
''::character varying
logo_url
character varying(2048)
''::character varying
creation_date
timestamp without time zone
now()
update_date
timestamp without time zone
now()
description
character varying(4096)
''::character varying
id
integer
not null
generated by default as identity
creation_date
timestamp without time zone
not null
modification_date
timestamp without time zone
not null
user_id
character varying(96)
not null
type
smallint
not null
name
text
uri
text
not null
user_history_id
integer
not null
prj_id
character varying(96)
not null
id
character varying(96)
not null
email
text
name
character varying(255)
provider
character varying(255)
details
text
'{}'::text
Deletes batch searches and results for the current user.
no content: idempotent
Preflight request
returns 200 with DELETE
Deletes a batch search and its results with the given id. It won't delete running batch searches, because results would be orphans.
Returns 204 (No Content) : idempotent
Preflight request
returns 200 with DELETE
Retrieves the results of a batch search as an attached CSV file.
returns the results of the batch search as CSV attached file.
Preflight request
returns OPTIONS and PUT
Preflight request
returns OPTIONS and DELETE
Preflight request for hide endpoint
returns PUT
Get the JSON OpenAPI v3 contract specification
returns the JSON file
Preflight request
returns OPTIONS and PUT
Preflight request
returns 200 with OPTIONS and DELETE
Uninstall plugin specified by its id.
returns 204 if the plugin is uninstalled (idempotent)
Preflight option request
returns 200 with OPTIONS and DELETE
Preflight request for batch download.
returns 200 with OPTIONS and POST
Preflight request for task cleaning.
returns OPTIONS and DELETE
Preflight request to stop tasks.
returns 200 with OPTIONS and PUT
Preflight request to stop all tasks.
returns 200 with OPTIONS and PUT
Preflight request for history
returns 200 with OPTIONS, GET, PUT and DELETE
Preflight request for history
returns OPTIONS and DELETE
Preflight for index creation.
returns 200 with PUT
Head request useful for JavaScript API (for example to test if an index exists)
returns 200
Deletes the project from database and elasticsearch index.
if project is deleted
Returns 200 if the project is allowed with this network route : in Datashare database there is the project table that can specify an IP mask that is allowed per project. If the client IP is not in the range, then the file download will be forbidden. In that project table there is a field called allow_from_mask
that can have a mask with IP and star wildcard.Ex : 192.168.. will match all subnetwork 192.168.0.0 IP's and only users with an IP in.
if project download is allowed for this project and IP
Gets the public (i.e. without user's information) datashare settings parameters.These parameters are used for the client app for the init process.The endpoint is removing all fields that contain Address or Secret or Url or Key
returns the list of public settings
Gets the user's session information.
returns the user map
Gets the versions (front/back/docker) of datashare.
returns the list of versions of datashare
Cancels the running tasks. It returns a map with task name/stop statuses.If the status is false, it means that the thread has not been stopped.
returns 200 and the tasks stop result map
Gets the project information for the given id
if the project is not found in database
Uninstall extension specified by its id.
id of the extension to uninstall
returns 204 if the extension is uninstalled (idempotent)
Gets the list of registered pipelines.
returns the pipeline set
Delete user event by id.
query to perform
Returns 204 (No Content) : idempotent
Deletes an apikey for current user. Only available in SERVER mode.
user identifier
when key has been deleted
Preflight for key management
user identifier
returns OPTIONS, GET, PUT and DELETE
Retrieves the batch search queries with the given batch id and returns a list of strings UTF-8 encoded
identifier of the batch search
if not provided it starts from 0
if not provided all queries are returned from the "from" parameter
if set to csv, it answers with content-disposition attachment (file downloading)
if provided it will filter the queries accordingly
field name to order by asc, "query_number" by default (if it does not exist it will return a 500 error)
number of maximum results for each returned query (-1 means no maxResults)
the batch search queries map [(query, nbResults), ...]
Preflight request for document tagging
the project id
document id
returns 200 with PUT
Preflight request for document untagging
the project id
document id
returns 200 with PUT
Hide all named entities with the given normalized mention
current project
normalized mention
returns 200 OK
Gets the list of notes for a project.
the project id
if the user is not granted for the project
Preflight request
returns POST
Get the private key for an existing user. Only available in SERVER mode.
user identifier
returns the hashed key JSON
Creates a new private key and saves its SHA384 hash into database for current user. Only available in SERVER mode.
user identifier
returns the api key JSON
Create the index for the current user if it doesn't exist.
index to create
returns 200 if the index already exists
Search GET request to Elasticsearch. As it is a GET method, all paths are accepted.if a body is provided, the body will be sent to ES as source=urlencoded(body)&source_content_type=application%2FjsonIn that case, request parameters are not taken into account.
elasticsearch path
returns 200
Creates a project
if project and index have been created
Cleans a specific task.
name of the task to delete
returns 200 if the task is removed
Cancels the task with the given name.
name of the task to cancel
returns 200 with the cancellation status (true/false)
Retrieves the set of recommended documents for the given project id and a list of users
comma separated users
default response
Retrieves the list of starred documents for a given project.
the project id
default response
Retrieves the list of tagged documents for a given project id filtered by a given string of coma-separated list of tags.
the project id
comma separated tags
default response
Download (if necessary) and install extension specified by its id or url.Request parameter id
or url
must be present.
id of the extension
url of the extension
returns 200 if the extension is installed
Download (if necessary) and install plugin specified by its id or url.Request parameter id
or url
must be present.
id of the plugin
url of the plugin
returns 200 if the plugin is installed
Retrieve the status of databus connection, database connection, shared queues and index.
if provided in the URL it will return the status in openmetrics format
returns the status of datashare elements
Delete user history by type.
type of user element
Returns 204 (No Content) : idempotent
Gets task result with its id
task id
returns 200 and the result
Gets all users who recommended a document with the count of all recommended documents for project and documents ids.
comma separated document ids
default response
Add event to history. The event's type, the project ids and the uri are passed in the request body.The project list related to the event is stored in database but is never queried (no filters on project)
query to perform
returns 200 when event is added or updated.
Creates a new batch search based on a previous one given its id, and enqueue it for running
source batch id
batch parameters
returns the id of the created batch search
Retrieves the list of users who recommended a document with the total count of recommended documents for the given project id
default response
Gets tags by document id
the project id
document id
default response
Cleans all DONE tasks.
returns 200 and the list of removed tasks
Gets the plugins set in JSON.If a request parameter "filter" is provided, the regular expression will be applied to the list.See https://docs.oracle.com/javase/8/docs/api/java/util/regex/Pattern.html for pattern syntax.
regular expression to apply
returns the plugins set
Gets one task with its id.
task id
returns the task from its id
Gets all the user tasks.A filter can be added with a pattern contained in the task name.
pattern contained in the task name
returns the list of tasks
Creates a new batch search. This is a multipart form with 8 fields:name, description, csvFile, published, fileTypes, paths, fuzziness, phrase_matchesQueries with less than two characters are filtered.To make a request manually, you can create a file like:--BOUNDARY"Content-Disposition: form-data; name="name"my batch search --BOUNDARYContent-Disposition: form-data; name="description"search description --BOUNDARYContent-Disposition: form-data; name="csvFile"; filename="search.csv"Content-Type: text/csvObamaskypetestquery three--BOUNDARY--Content-Disposition: form-data; name="published"true--BOUNDARY--Then curl withcurl -i -XPOST localhost:8080/api/batch/search/prj1,prj2 -H 'Content-Type: multipart/form-data; boundary=BOUNDARY' --data-binary @/home/dev/multipart.txtyou'll maybe have to replace \n with \n\r with sed -i 's/$/^M/g' ~/multipart.txt
Coma-separated list of projects
multipart form
if either name or CSV file is missing
Lists all files and directory for the given path. This endpoint returns a JSON using the same specification than the tree
command on UNIX. It is roughly the equivalent of:tree -L 1 -spJ --noreport /home/datashare/data
directory path in the tree
returns the list of files and directory
Indexes files in a directory (with docker, it is the mounted directory that is scanned).
wrapper for options json
returns 200 and the list of tasks created
Download files from a search query.Expected parameters are :- project: string- query: string or elasticsearch JSON queryIf the query is a string it is taken as an ES query string, else it is a raw JSON query (without the query part),see org.elasticsearch.index.query.WrapperQueryBuilder that is used to wrap the query
the json used to wrap the query
returns 200 and the json task
Indexes files from the queue.
wrapper for options json
returns 200 and the json task
When datashare is launched in NER mode (without index) it exposes a name finding HTTP API.The text is sent with the HTTP body.
pipeline to use
text to analyze in the request body
returns the list of NamedEntities annotations
Retrieves the batch search list for the user issuing the request filter with the given criteria, and the total of batch searches matching the criteria.If from/size are not given their default values are 0, meaning that all the results are returned. BatchDate must be a list of 2 items (the first one for the starting date and the second one for the ending date) If defined publishState is a string equals to "0" or "1"
the json webQuery request body
the list of batch searches with the total batch searches for the query
Gets the extension set in JSON.If a request parameter "filter" is provided, the regular expression will be applied to the list.See https://docs.oracle.com/javase/8/docs/api/java/util/regex/Pattern.html for pattern syntax.
regular expression to apply
returns the extensions set
Retrieves the batch search list for the user issuing the request
200 and the list of batch search
Retrieves the batch search with the given id. The query param "withQueries" accepts a boolean value.When "withQueries" is set to false, the list of queries is empty and nbQueries contains the number of queries.
Retrieves the list of starred document for all projects for the current user.
default response