Selecting the API option in the left sidebar will open the window shown above (by default, at http://localhost:30000/api/v1).
This displays the API visually using Swagger. For production use, curl can be used; sample curl calls for the various endpoints are available within Swagger.
As discussed here, Curiefense's data is stored within:
Configurations
Documents
Entries
Blobs
A Configuration is a set of Blobs and Documents. A Document is a set of Entries.
All of these data structures can be edited via API:
A Document is a file treated as a JSON list of entries.
An entry is a JSON dictionary with an id
field. The id
field value must be unique inside the document, and must be a valid part of an URL.
A Blob is a file treated as binary data.
Each time a Configuration is modified, a new version is created. A Configuration can be reverted back to a previous version at any time.
The Curiefense API has the following namespaces:
configs (for manipulating Configurations)
db (for accessing persistent key value storage)
tools (for publishing, etc.)
Each namespace contains various endpoints. For example, tools contains five:
Swagger is a useful way to experiment with the API. For example, selecting configs will display a list of endpoints. If you select this one:
... and then select the Try it out button, followed by the Execute button, this will be the result:
This allows you to interact with the API, try different commands, and see what responses will be generated.
As shown in the example above, Swagger will include sample curl commands for each namespace and endpoint. The commands can be copied and pasted for use elsewhere.
For some endpoints, arguments need to be supplied. Swagger will create defaults/samples, and provide input controls for them, as in this example:
Here a sample payload has been created, and is being displayed for editing. After it is edited, selecting the Execute button will display the responses that are generated.
Here are some examples of sending API requests to Curiefense using curl.
This list is not meant to be exhaustive, and might not reflect recent changes to the API. For current and canonical information about API operations and data structures, the Swagger interface is recommended.
Get the detailed list of existing configurations:
Retrieve a complete configuration:
Create a new configuration, name is in the posted data:
Create a new configuration, name is provided and overrides posted data:
Update an existing configuration:
Delete a configuration:
Clone a configuration, new name is in POST data:
Clone a configuration, new name is in the URL:
Get all versions of a given configuration:
Retrieve a specific version of a configuration:
Create a new version for a configuration from an old version:
Retrieve the list of existing documents in this configuration:
Get a complete document:
Get a given version of a document:
Retrieve the existing versions of a given document:
Create a new complete document:
Update an existing document:
Delete/empty a document:
Create a new version for a document from an old version:
Retrieve the list of entries in a document:
Retrieve an entry from a document:
Get the list of existing versions of a given entry in a document:
Get a given version of a document entry:
Create an entry in a document:
Update an entry in a document:
Delete an entry from a document:
Retrieve the list of available blobs:
Retrieve a blob:
Create a new blob:
Replace a blob with new data:
Delete a blob:
Retrieve the list of versions of a given blob:
Retrieve the given version of a blob:
Create a new version for a blob from an old version: