Entities Functionality
These endpoints provide additional functionality for managing entities, such as permissions, truncation, validation, and domain operations.
Endpoints
Section titled “Endpoints”Get all entities
Section titled “Get all entities”Returns a list of all entities in the system.
Endpoint:
GET /api/v1/entities?version=:versionExample Response:
{"status": 200,"error": false,"errors": [ { } ],"message": "string","data": [ { <Entity> } ],"pagination": { <Pagination> }}
Get all entities (formatted)
Section titled “Get all entities (formatted)”Returns all entities in a formatted structure.
Endpoint:
GET /api/v1/entities/formated?version=:versionExample Response:
{"status": 200,"error": false,"errors": [ { } ],"message": "string","pagination": { <Pagination> },"data": [{"label": "label","name": "entity"}]}
Truncate entity data
Section titled “Truncate entity data”Removes all data from the specified entity (table), but keeps the entity definition.
Endpoint:
DELETE /api/v1/entities/:entity/truncate?version=:versionResponse codes:
200 OK: Successfully truncated the entity data.500 Internal Server Error: An error occurred while truncating the entity data.
Validate an entity record
Section titled “Validate an entity record”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> }}
Entity permission management
Section titled “Entity permission management”Get entity permissions
Section titled “Get entity permissions”Retrieves the permissions associated with a specific entity.
Endpoint:
GET /api/v1/entities/:entity/permissions?version=:versionExample Response:
{"status": 200,"error": false,"message": "string","entityName": "string","data": [{"permissionId": "string","roleId": "string","roleItem": "string","actionId": "string","actionItem": "string","active": true}]}
Set entity permissions
Section titled “Set entity permissions”Sets or updates the permissions for a specific entity.
Endpoint:
POST /api/v1/entities/:entity/permissions?version=:versionRequest 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}]}
Entity management within domains
Section titled “Entity management within domains”Move an entity record to a new domain
Section titled “Move an entity record to a new domain”Moves an entity record from its current domain to another.
Endpoint:
PUT /api/v1/entities/:entity/:id/domain?version=:versionParameters:
Name Type From Description versionstring query The version of the application. entitystring path The name of the entity. idnumber path The 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}}