-
Notifications
You must be signed in to change notification settings - Fork 2
HTTP API Documentation
Adrian Burlacu edited this page May 13, 2024
·
1 revision
| Name | Located in | Description | Required | Schema |
|---|---|---|---|---|
| DB | path | The database. | Yes | string |
| pid | query | The process ID. This is generated by the client. | Yes | string |
{
"username": "admin",
"password": "admin"
}| Code | Description |
|---|---|
| 200 | The login was sucessful. |
| 401 | The login failed for the credentials. |
| 403 | The login failed for the DB. |
Logs out of a user.
| Name | Located in | Description | Required | Schema |
|---|---|---|---|---|
| pid | query | The process ID. This is generated by the client. | Yes | string |
| Code | Description |
|---|---|
| 200 | The logout was successful. |
Get the users in the system. Regular users can only get their own user. Admins can get all the users.
| Name | Located in | Description | Required | Schema |
|---|---|---|---|---|
| pid | query | The process ID. This is generated by the client. | Yes | string |
| ID | query | The user ID. | No | string |
| name | query | The username. | No | string |
| Code | Description |
|---|---|
| 200 | The requested user(s). |
| 401 | The user is not logged in. |
| 403 | The logged in user either doesn't have permission to view the user or the user wasn't found. |
Add a user. Only Admins can do this.
| Name | Located in | Description | Required | Schema |
|---|---|---|---|---|
| pid | query | The process ID. This is generated by the client. | Yes | string |
{
"username": "admin",
"password": "admin",
"salt": ""
}| Code | Description |
|---|---|
| 200 | The user was added. |
| 401 | The user is not logged in. |
| 403 | The logged in user doesn't have permission to add the user or the user entity had an error. |
Set user
Set a user. Regular users can only set their own user. Admins can set any user.
| Name | Located in | Description | Required | Schema |
|---|---|---|---|---|
| pid | query | The process ID. This is generated by the client. | Yes | string |
{
"ID": 2,
"username": "user1",
"password": "password1",
"salt": ""
}| Code | Description |
|---|---|
| 200 | The user was set. |
| 401 | The user is not logged in. |
| 403 | The logged in user either doesn't have permission to set the user or the user entity was not found. |
Delete a user. Regular users can only delete their own user. Admins can delete any user.
| Name | Located in | Description | Required | Schema |
|---|---|---|---|---|
| pid | query | The process ID. This is generated by the client. | Yes | string |
| ID | query | The user ID | No | string |
| name | query | The username | No | string |
| Code | Description |
|---|---|
| 200 | The user was deleted |
| 401 | The user is not logged in. |
| 403 | The logged in user either doesn't have permission to delete the user or the user wasn't found. |
Get the DBs in the system. Regular users can only get their own DBs. Admins can get all the DBs.
| Name | Located in | Description | Required | Schema |
|---|---|---|---|---|
| pid | query | The process ID. This is generated by the client. | Yes | string |
| ID | query | The DB ID. | No | string |
| name | query | The DB name. | No | string |
| Code | Description |
|---|---|
| 200 | The requested DB(s). |
| 401 | The user is not logged in. |
| 403 | The logged in user either doesn't have permission to get the DB or the DB wasn't found. |
Add a DB. Only Admins can do this.
| Name | Located in | Description | Required | Schema |
|---|---|---|---|---|
| pid | query | The process ID. This is generated by the client. | Yes | string |
{
"name": "database1",
"admins": [
1,
2
],
"readers": [],
"writers": []
}| Code | Description |
|---|---|
| 200 | The DB was added. |
Set a DB. DB Admins can update their own DBs while Admins can update all DBs.
{
"ID": 2,
"name": "database1",
"admins": [
1,
2
],
"readers": [],
"writers": []
}| Name | Located in | Description | Required | Schema |
|---|---|---|---|---|
| pid | query | The process ID. This is generated by the client. | Yes | string |
| Code | Description |
|---|---|
| 200 | The DB was set. |
Delete a DB. DB Admins can delete their own DBs while Admins can delete any DB.
| Name | Located in | Description | Required | Schema |
|---|---|---|---|---|
| pid | query | The process ID. This is generated by the client. | Yes | string |
| ID | query | The DB ID | No | string |
| name | query | The DB name | No | string |
| Code | Description |
|---|---|
| 200 | The DB was deleted |
Queries a database.
| Name | Located in | Description | Required | Schema |
|---|---|---|---|---|
| DB | path | The database. | Yes | string |
| pid | query | The process ID. This is generated by the client. | Yes | string |
{
"query": "SELECT * FROM sqlite_master;",
"params": []
}| Code | Description |
|---|---|
| 200 | The successful query results. |
| 401 | The login failed for the credentials. |
| 403 | The login failed for the DB. |
| 500 | The server was not able to respond to the query. |