Skip to content

Entities Functionality

These endpoints provide additional functionality for managing entities, such as permissions, truncation, validation, and domain operations.

Returns a list of all entities in the system.

Endpoint:

GET /api/v1/entities?version=:version

Example Response:

{
"status": 200,
"error": false,
"errors": [ { } ],
"message": "string",
"data": [ { <Entity> } ],
"pagination": { <Pagination> }
}

Returns all entities in a formatted structure.

Endpoint:

GET /api/v1/entities/formated?version=:version

Example Response:

{
"status": 200,
"error": false,
"errors": [ { } ],
"message": "string",
"pagination": { <Pagination> },
"data": [
{
"label": "label",
"name": "entity"
}
]
}

Removes all data from the specified entity (table), but keeps the entity definition.

Endpoint:

DELETE /api/v1/entities/:entity/truncate?version=:version

Response codes:

  • 200 OK: Successfully truncated the entity data.
  • 500 Internal Server Error: An error occurred while truncating the entity data.

Validates a record before it is updated. Useful for checking data integrity or business rules before saving changes.

Endpoint:

PUT /api/v1/entities/:entity/:id/validate?version=:version
<JSON>

Example Response:

{
"data": [],
"status": 200,
"error": false,
"errors": [ { } ],
"message": "string",
"pagination": { <Pagination> }
}

Retrieves the permissions associated with a specific entity.

Endpoint:

GET /api/v1/entities/:entity/permissions?version=:version

Example Response:

{
"status": 200,
"error": false,
"message": "string",
"entityName": "string",
"data": [
{
"permissionId": "string",
"roleId": "string",
"roleItem": "string",
"actionId": "string",
"actionItem": "string",
"active": true
}
]
}

Sets or updates the permissions for a specific entity.

Endpoint:

POST /api/v1/entities/:entity/permissions?version=:version

Request Body:

[
{
"permissionId": "string",
"actionItem": "string",
"actionId": "string",
"roleItem": "string",
"roleId": "string",
"active": true
}
]

Example Response:

{
"status": 201,
"error": false,
"message": "string",
"entityName": "string",
"data": [
{
"permissionId": "string",
"actionItem": "string",
"actionId": "string",
"roleItem": "string",
"roleId": "string",
"active": true
}
]
}

Moves an entity record from its current domain to another.

Endpoint:

PUT /api/v1/entities/:entity/:id/domain?version=:version

Parameters:

NameTypeFromDescription
versionstringqueryThe version of the application.
entitystringpathThe name of the entity.
idnumberpathThe ID of the entity.

Request Body:

{
"newDomain": 1
}

Example response:

{
"error": false,
"status": 200,
"message": "string",
"errors": [
{}
],
"data": {
"id": 0,
"domain": 1,
"createdBy": "string",
"updatedBy": "string",
"dateUpdated": "string",
"dateCreated": "string",
"securityGroup": "string",
"data": {
"additionalProp1": "string",
"additionalProp2": "string",
"additionalProp3": "string"
}
},
"pagination": {
"hasPreviousPage": true,
"hasNextPage": true,
"previousPage": 0,
"nextPage": 0,
"recordsTotal": 0,
"currentPage": 0,
"startIndex": 0,
"numPages": 0,
"limit": 0
}
}