diff --git a/integration/rest.md b/integration/rest.md index 8566c49..b99ceea 100644 --- a/integration/rest.md +++ b/integration/rest.md @@ -8,31 +8,17 @@ parent: "integration" | Request Name | Request Endpoint | Request Method | Request Headers | Request Parameters | Body | Successful Response | Description| | ------------- | ---------------- | -------------- | --------------- | ------------------ | ---- | ------------------- | ---------- | | Login | [/api/auth/providers](http://localhost:3000/api/auth/providers) | GET | None | None | None | Status Code: 200
{
"credentials": {
"id": "credentials",
"name": "Credentials",
"type": "credentials",
"signinUrl": "http://localhost:3000/api/auth/signin/credentials",
"callbackUrl": "http://localhost:3000/api/auth/callback/credentials"
}
} | This request is used for user authentication. | - | Logout | [/api/auth/signout](http://localhost:3000/api/auth/signout) | POST | Content-Type: application/x-www-form-urlencoded | None | x-www-form-urlencoded:
1- Key: csrfToken – value: insert csrfToken
2- Key: callbackUrl – value: /login
3- Key: json - value: true | Status Code: 200
{
"url": "http://localhost:3000/api/auth/signout?csrf=true"
} |
This request is used to sign out users, ending their current authenticated session and logging them out of the system | - | Modify config role | [/api/graph?config=MAX_QUEUED_QUERIES&value=10](http://localhost:3000/api/graph?config=MAX_QUEUED_QUERIES&value=10) | POST | Authorization: Cookie | 1\. Key: config - Value: MAX_QUEUED_QUERIES (required)
2\. Key: value - Value: A number (required) | None | Status Code: 200
Response Body:
{ "config": "OK" } | This request is used to set a configuration value for MAX_QUEUED_QUERIES. It accepts a number as the value for the configuration and requires authorization via a cookie in the headers. | - | Get config role value | [/api/graph?config=MAX_QUEUED_QUERIES](http://localhost:3000/api/graph?config=MAX_QUEUED_QUERIES) | GET | Authorization: Cookie | 1\. Key: config - Value: MAX_QUEUED_QUERIES (required)
2\. Key: value - Value: A number (required) | None | Status code: 200
{"config": [ "MAX_QUEUED_QUERIES",25 ]} | This request is used to get a configuration value for MAX_QUEUED_QUERIES. It accepts a number as the value for the configuration and requires authorization via a cookie in the headers. | - | Create new user | [/api/user](http://localhost:3000/api/user) | POST | Authorization: Cookie | None | {
"username":"user",
"password":"password",
"role":"Read-Write"
} | Status Code: 201
{ "message": "User created"} | This request is used to create a new user with specified credentials. The required data, including the username, password, and role, is passed in the body of the request. Authorization is provided via a cookie in the headers. | - | Delete user | [/api/user](http://localhost:3000/api/user) | DELETE | Authorization: Cookie | None | {
"users":
[
{
"username":"userName",
"role":"Read-Write"
}
]
} | Status Code: 200
{
"message": "Users deleted"
} | This request is used to delete a user with specified credentials. The required data, including the username and role, is passed in the body of the request. Authorization is provided via a cookie in the headers. | - | Get All Users | [/api/user](http://localhost:3000/api/user) | GET | Authorization: Cookie | None | None | Status Code: 200
{
"result": [
{
"username": "default",
"role": "Admin",
"checked": false
}
]
} | This request retrieves a list of all users. Authorization is required via a cookie in the headers.






| - | Modify User Role | [/api/user/userName?role=Read-Only](http://localhost:3000/api/user/userName?role=Read-Only) | PATCH | Authorization: Cookie | 1\. Key: role - value: (e.g Admin, Read-Only, Read-Write)
2\. userName | None | Status Code: 200
{
"message": "Users created"
} |
This request updates the role of a specific user. The userName in the URL must be replaced with the actual username of the user whose role is being modified, and the role query parameter must be set to the desired role (e.g., Admin, Read-Only, Read-Write). Authorization is required via a cookie in the headers. | - | Create new Graph | [/api/graph/graphName?query=RETURN%201](http://localhost:3000/api/graph/graphName?query=RETURN%201) | GET | Authorization: Cookie | 1\. Graph name | None | Status Code: 200
{
"result": {
"metadata": [
"Cached execution: 0",
"Query internal execution time: 7.198178 milliseconds"
],
"data": [
{
"1": 1
}
]
}
} | This request creates a new graph with the specified name. Authorization is required via a cookie in the headers. The response includes metadata and data from the query execution. | - | Delete Graph | [/api/graph/graphName](http://localhost:3000/api/graph/graphName) | DELETE | Authorization: Cookie | 1\. Graph name | None | Status Code: 200
{
"message": "GraphName graph deleted"
} | This request deletes the graph with the specified name. Authorization is required via a cookie in the headers. The response confirms the deletion of the graph. | - | Get All Graphs | [/api/graph](http://localhost:3000/api/graph) | GET | Authorization: Cookie | None | None | Status Code: 200
{
"result": [ "graphName" ]
} | This request retrieves a list of all graphs. Authorization is required via a cookie in the headers. The response includes a list of graph names. | - | Run A Query | [/api/graph/graphName?query=yourQuery](http://localhost:3000/api/graph/graphName?query=yourQuery) | GET | Authorization: Cookie | 1\. Graph name
2\. Key: query - value: yourQuery | None | Status Code: 200
{
"result": {
"metadata": [
"Nodes created: 40",
"Relationships created: 20",
"Cached execution: 1",
"Query internal execution time: 0.201420 milliseconds"
],
"data": [ { queryData… } ]
} | This request runs a query on the specified graph. Authorization is required via a cookie in the headers. The response includes metadata about the query execution and the resulting data. | - | Duplicate A Graph | [/api/graph/destinationGraphName?sourceName=yourSourceName](http://localhost:3000/api/graph/destinationGraphName?sourceName=yourSourceName) | POST | Authorization: Cookie | 1\. destinationGraphName
2\. Key: sourceName - Value: yourSourceName | None | Status Code: 200
{ "success": "OK" } | This request duplicates a graph from a source to a destination. Authorization is required via a cookie in the headers. The response confirms the successful duplication of the graph. | - | Create New Schema | [/api/graph/schemaName?query=RETURN%201](http://localhost:3000/api/graph/schemaName?query=RETURN%201) | GET | Authorization: Cookie | 1\. schemaName | None | Status Code: 200
{
"result": {
"metadata": [
"Cached execution: 0",
"Query internal execution time: 0.153307 milliseconds"
],
"data": [
{
"1": 1
}
]
}
} | This request creates a new schema with the specified name. Authorization is required via a cookie in the headers. The response includes metadata and data from the query execution.
| - | Delete A Schema | [/api/graph/schemaName](http://localhost:3000/api/graph/schemaName) | DELETE | Authorization: Cookie | 1\. schemaName | None | Status Code: 200
{
"message": "schemaName graph deleted"
} | This request deletes the schema with the specified name. Authorization is required via a cookie in the headers. The response confirms the deletion of the schema. | \ No newline at end of file