Databases
Endpoints to manage the list of databases.
For the definition of the database and explanation how it should be used, see this page.
You need to be authenticated and have your OAuth access token before sending requests. See authentication for more details.
POST /database/{$databaseName}
Create an empty database.
cURL example
curl \
-X POST \
-H 'Content-Type: application/json' \
-H 'Authorization: Bearer {YOUR_ACCESS_TOKEN}' \
-d '' \
https://dtxs-server.example.com/database/TestDatabase
Parameters
| Parameter | Required | Description | Example |
|---|---|---|---|
| databaseName | yes, extracted from endpoint URL | Name of the database to create. | TestDatabase |
Responses
| Code | Description | Return value | Example |
|---|---|---|---|
| 200 | Success. | Name of the created database. | TestDatabase |
| 400 | Unknown error. | ||
| 406 | Format of the request is not valid or database already exists. |
DELETE /database/{$databaseName}
Delete a database.
cURL example
curl \
-X DELETE \
-H 'Content-Type: application/json' \
-H 'Authorization: Bearer {YOUR_ACCESS_TOKEN}' \
-d '' \
https://dtxs-server.example.com/database/TestDatabase
Parameters
| Parameter | Required | Description | Example |
|---|---|---|---|
| databaseName | yes, extracted from endpoint URL | Name of the database to delete. | TestDatabase |
Responses
| Code | Description | Return value | Example |
|---|---|---|---|
| 200 | Success. | ||
| 400 | Unknown error. | ||
| 401 | Not authorized. | ||
| 404 | Database does not exist. | ||
| 406 | Format of the request is not valid. | ||
| 500 | Database is not being deleted by the owner |
GET /databases
Get list of all available databases.
cURL example
curl \
-X GET \
-H 'Content-Type: application/json' \
-H 'Authorization: Bearer {YOUR_ACCESS_TOKEN}' \
-d '' \
https://dtxs-server.example.com/databases
Parameters
No parameters.
Responses
| Code | Description | Return value | Example |
|---|---|---|---|
| 200 | Success. | List of available databases. | See example. |
| 400 | Unknown error. | ||
| 401 | Not authorized. |
Examples
Successful response for GET /databases
[
{
"name": "testDatabase",
information: { createdBy: 'your.name', owner: 'your.name', permissions: {}, documentsSize: 310, documentsCount: 2 }
},
{
"name": "testDatabase2",
information: { createdBy: 'other.name', owner: 'other.name', permissions: {}, documentsSize: 310, documentsCount: 2 }
}
]