This section of the RestPose documentation details the URLs at which RestPose makes resources available.
There are three ways to pass parameters in HTTP requests:
- As part of the request path (referred to in the following documentation as Parameters).
- As part of the request query string (referred to in the following documentation as Query Parameters).
- As part of the request body. Where this is applicable, the details of the body to supply is described below.
When a parameter is documented as accepting a boolean value, “true” can be represented as 1, true, yes or on, and “false” can be represented as 0, false, no or off (with all strings comparisons here being case insensitive).
Where non-unicode strings need to be returned, they will be escaped using C-style escaping. More precisely:
- \ will be represented as \\
- Tab (hex code 0x09) will be represented as \t
- Line feed (hex code 0x0a) will be represented as \n
- Carriage return (hex code 0x0d) will be represented as \r
- Characters from 0x32 to 0x7f (inclusive) will be represented as themselves.
- Any other characters will be represented as \xXX, where XX is the hex representation of the character code.
If a 400 or 500 series HTTP error code is returned from the following methods, except where noted otherwise, the response body will be of type application/json, and will contain a JSON object with, at least, an err property, containing a string describing the error.
Everything to do with collections is available under the /coll URL.
Get details of the collections held by the server.
Takes no parameters.
Status Codes: |
|
---|
Parameters: |
|
---|
On success, the return value is a JSON object with the following members:
- doc_count: The number of documents in the collection.
Status Codes: |
|
---|
Parameters: |
|
---|
The collection of the given name is deleted, if it exists. If it doesn’t exist, returns successfully, but doesn’t change anything.
Status Codes: |
|
---|
The collection configuration is represented as a JSON object; for details of its contents, see Collection Configuration.
Get the collection configuration.
Parameters: |
|
---|---|
Status Codes: |
|
Set the collection configuration. Actually, adds a task to set the collection configuration to the processing queue. This may be monitored, waited for, and committed using checkpoints in just the same way as for the document addition APIs.
Creates the collection if it didn’t exist before the call.
Parameters: |
|
---|---|
Status Codes: |
|
Checkpoints are used to control committing of changes, sequence order of modification operations, and also to allow a client to wait until changes have been applied.
Note that checkpoints will be removed automatically after a timeout (though by default this timeout is around 1 day, so this will rarely be an issue in practice).
Checkpoints also do not persist across server restarts.
Get details of the checkpoints which exist for a collection.
Parameters: |
|
---|---|
Status Codes: |
|
Create a checkpoint.
Parameters: |
|
---|---|
Query Parameters: | |
|
|
Status Codes: |
|
Get the status of a checkpoint. If the checkpoint doesn’t exist (or has expired), or the collection doesn’t exist, returns a null JSON value.
Parameters: |
|
---|---|
Status Codes: |
|
A RestPose collection can contain a set of Taxonomies, each of which is identified by a name, and which contains a set of Categories. Each Category in a Taxonomy may be associated with other categories in parent-child relationships.
Get a list of all taxonomies available in the collection.
Parameters: |
|
---|---|
Status Codes: |
|
Get details of the named taxonomy in the collection.
Parameters: |
|
---|---|
Status Codes: |
|
Get details of a category in a named taxonomy in the collection.
Parameters: |
|
---|---|
Status Codes: |
|
Check if a category has a given parent, in the named taxonomy in the collection.
Parameters: |
|
---|---|
Status Codes: |
|
Add a parent to a category, creating the collection, taxonomy, category and parent if needed.
This will also update any documents which need to be updated to ensure that category searches still return the right answers.
Parameters: |
|
---|---|
Status Codes: |
|
Delete an entire taxonomy.
This will also update any documents which need to be updated as a result of there no longer being any category relationships in that taxonomy.
Parameters: |
|
---|---|
Status Codes: |
|
Remove a category. Will create the collection and taxonomy if they don’t already exist.
This will also update any documents which need to be updated as a result of there no longer being any category relationships involving that category.
Parameters: |
|
---|---|
Status Codes: |
|
Remove a parent from a category. Will create the collection and taxonomy if they don’t already exist.
This will also update any documents which need to be updated to ensure that category searches still return the right answers.
Parameters: |
|
---|---|
Status Codes: |
|
Get the stored information about the document of given ID and type.
Note that the information returned is not exactly the same as that supplied when the document was indexed: the returned information depends on the stored fields, but also includes the indexed information about the document.
Parameters: |
|
---|---|
Status Codes: |
|
Create, or update, a document with the given collection_name, type and id.
Creates the collection with default settings if it didn’t exist before the call.
Parameters: |
|
---|---|
Status Codes: |
|
Create, or update, a document with the given collection_name and type. The id of the document will be read from the document body, from the field configured in the collection configuration for storing IDs (by default, this is id).
Creates the collection with default settings if it didn’t exist before the call.
Parameters: |
|
---|---|
Status Codes: |
|
Create, or update, a document with the given collection_name and id. The type of the document will be read from the document body, from the field configured in the collection configuration for storing types (by default, this is type).
Creates the collection with default settings if it didn’t exist before the call.
Parameters: |
|
---|---|
Status Codes: |
|
Create, or update, a document in the collection collection_name. The type and ID of the document will be read from the document body, from the fields configured in the collection configuration for storing types and IDs (by default, these are type and id).
Creates the collection with default settings if it didn’t exist before the call.
Parameters: |
|
---|---|
Status Codes: |
|
Delete a document from a collection.
Parameters: |
|
---|---|
Status Codes: |
|
Searches are performed by sending a JSON search structure in the request body. This may be done using a GET request, but will usually be done with a POST request, since not all software supports sending a body as part of a GET request.
Search for documents in a collection, across all document types.
The search is sent as a JSON structure in the request body: see the Searches section for details on the search structure.
Parameters: |
|
---|---|
Status Codes: |
|
Search for documents in a collection, and with a given document type.
The search is sent as a JSON structure in the request body: see the Searches section for details on the search structure.
Parameters: |
|
---|---|
Status Codes: |
|
Gets details of the status of the server.
Status Codes: |
|
---|
Static files are served from the static directory. This is intended for hosting pretty web interfaces for server administration and management.
Status Codes: |
|
---|