API for Assets Tasks
Overview
The Assets APIs provide endpoints for managing assets categories, assets groups, assets tasks and sign off tasks within the MXSuite system. This API allows you to retrieve assets categories, assets groups and task sign offs, to create, update, delete and retrive assets tasks with proper authorization controls.
Base URL
- api/external/AssetsCategories/
- api/external/AssetsGroups/
- api/external/AssetsTasks/
- api/external/AssetsTaskSignOffs/
1. Assets Categories
Overview
Base URL
api/external/AssetsCategories/
Authentication
Endpoints
1. Get categories
Endpoint:GET /api/external/AssetsCategories/Get?locationName=Neptune
Request:
Query parameter:
• locationName=Neptune
Validations:
- LocationName: Required, max length 128.
Response:
[
{
"id": "b1a2c3d4-e5f6-7890-abcd-1234567890ab",
"uniqueId": "CAT-001",
"name": "Engine Room",
"parentId": "c2b3a4d5-e6f7-8901-bcda-2345678901bc",
"displayIndex": 1
}
]
2. Assets Groups
Overview
Base URL
api/external/AssetsGroups/
Authentication
Endpoints
1. Get groups
Endpoint:
GET /api/external/AssetsGroups/Get?categoryId=b1a2c3d4-e5f6-7890-abcd-1234567890ab
Request:
Query parameter:
• categoryId=b1a2c3d4-e5f6-7890-abcd-1234567890ab
Response:
[
{
"id": "d3e4f5a6-b7c8-9012-cdab-3456789012cd",
"type": 1,
"uniqueId": "GRP-001",
"name": "Auxiliary Systems",
"displayIndex":1
}
]
Validations:
- CategoryId: Required, valid GUID
3. Assets Tasks
Overview
Base URL
api/external/AssetsTasks/
Authentication
Endpoints
1. Create Maintenance Task
Endpoint
Authorization Required:
- User must have AddMaintenanceTask rights
{
"GroupId":"3C160DF1-3A5C-406F-BAC6-00A4AB8C44A9",
"GroupType":1,
"UniqueId": "Task-001",
"TaskName": "Oil Change - Updated",
"Interval": 45,
"IntervalType": 1,
"DueDate": "2025-06-01T00:00:00Z",
"IsCounterBased": false,
"IsRemarkMandatory": true,
"IsProject": false,
"IsRecurrent": true,
"IsFixedInterval": true,
"IsAtServiceRequest": false,
"IsDefect": false,
"TaskDescription": "Updated description for oil change.",
"MaxInterval": 90,
"MaxIntervalType": 2,
"DueCounters": 150,
"Downtime": 3.0,
"WarningInterval": 10,
"WarningIntervalType": 1,
"CounterName": "Main Engine",
"DefaultEstimatedBudget": {
"Amount": 600.0,
"Currency": "USD"
},
"Ranks": ["Rank1", "Rank2"],
"ApproverRanks": ["Approver1"],
"RequiresApproval": true
}
Validations
- LocationName: Required, max length 128.
- UniqueId: Max length 50, must be unique.
- TaskName: Required, max length 128, must be unique.
- Interval: Must be greater than 0, within limits based on IntervalType.
- DueDate: Must be between 01/01/1900 and 01/01/2100.
- TaskDescription: Required for certain task types
- Ranks: Required for tasks requiring approval.
- RequiresApproval: Must be false for non-advanced licenses.
- ApproverRanks: only if RequiresApproval is true.
Errors
- 409 Conflict
- 404 Not Found: Task not found.
- 412 Precondition failed: Exceeding limits for intervals
- 403 Forbidden
- 400 Bad Request: Validation errors and required fields
Response
{
"TaskId": "1463aea5-9062-45bf-8b9c-24cc5615d467"
}
2. Update Maintenance Task
Endpoint
Authorization Required
- User must have EditMaintenanceTask rights
{
"UniqueId": "Task-001",
"TaskName": "Oil Change - Updated",
"TaskId": "1463aea5-9062-45bf-8b9c-24cc5615d467",
"GroupId":"3C160DF1-3A5C-406F-BAC6-00A4AB8C44A9",
"GroupType":1,
"Interval": 45,
"IntervalType": 1,
"DueDate": "2025-06-01T00:00:00Z",
"IsCounterBased": false,
"IsRemarkMandatory": true,
"IsProject": false,
"IsRecurrent": true,
"IsFixedInterval": true,
"IsAtServiceRequest": false,
"IsDefect": false,
"TaskDescription": "Updated description for oil change.",
"MaxInterval": 90,
"MaxIntervalType": 2,
"DueCounters": 150,
"Downtime": 3.0,
"WarningInterval": 10,
"WarningIntervalType": 1,
"CounterName": "Main Engine",
"DefaultEstimatedBudget": {
"Amount": 600.0,
"Currency": "EURO"
},
"Ranks": ["Rank1", "Rank2"],
"ApproverRanks": ["Approver1"],
"RequiresApproval": true
}
Validations
Same as the Create action.
Errors
- 409 Conflict
- 404 Not Found: Task not found.
- 412 Precondition failed: Exceeding limits for intervals
- 403 Forbidden
- 400 Bad Request: Validation errors and required fields
Validations
• taskId: Required, must be a valid GUID.
Errors
• 404 Not Found: Task not found.
• 500 Internal Server Error: Unexpected errors.
4. Get
Endpoint
/api/external/AssetsTasks/Get?taskId={taskId}
Validations
• taskId: Required, must be a valid GUID.
5. Get Multiple Tasks
Endpoint
/api/external/AssetsTasks/GetTasks
Request JSON
[
"1463aea5-9062-45bf-8b9c-24cc5615d467",
"7b95cb8b-0cb8-4cdf-ad3e-3285a162cbea"
]
Validations
• taskIds: Required, must be a list of valid GUIDs.
6. Get Tasks Ids
Retrieves the IDs of maintenance task/s.
• URL: /api/external/AssetsTasks/GetTasksIds
Authorization Required
- Location must not be read-only
Request body
{
"GroupId": "d3e4f5a6-b7c8-9012-cdab-3456789012cd",
"GroupType": 1
}
[
"e4f5a6b7-c8d9-0123-dabc-4567890123de",
"f5a6b7c8-d9e0-1234-abcd-5678901234ef"
]
4. Assets Task Sign Offs
Overview
Base URL
api/external/AssetsTaskSignOffs/
Authentication
Endpoints
1. Get Sign-Offs
{
"TaskId": "7b95cb8b-0cb8-4cdf-ad3e-3285a162cbea",
"NumberOfSignOffs": 5
}
Validations
• TaskId: Required, must be a valid GUID.
• NumberOfSignOffs: Optional, must be a valid number.
• The LocationIsNotReadOnly flag must be true for all operations.
Error Responses
All error responses follow this structure:
{
"Errors": [
{
"message": "string",
"errorCode": number,
"isBusinessException": false,
"businessExceptionData": null,
"failureServerReason": null
}
]
}
{
"errors": [
{
"message": "Category name is required",
"errorCode": 9,
"isBusinessException": false,
"businessExceptionData": null,
"failureServerReason": null
}
]
}
- 400 Bad Request
- When request validation fails
- When required fields are missing
- When field values are invalid
- 403 Forbidden
- When location is read-only
- When user doesn't have sufficient permissions
- 404 Not Found
- When requested task doesn't exist
- When location or category doesn't exist
- 409 Conflict
- When trying to create a duplicate task
- When task name already exists in the specified location/category/group
Validation Rules and status codes
Status: 400 Bad Request
No Comments