Workflow APIs
Get Workflows (GET)
Returns all workflow definitions.
Route
|
URI |
/api/v1/Workflow/GetWorkflows |
|
Method |
GET |
|
Result |
JSON – Array of WorkflowModel |
Parameters
None
Response Structure
Returns array of WorkflowModel objects, each containing:
-
WorkflowId: Unique identifier
-
Name: Workflow name
-
Description: Workflow description
-
ApprovalSteps: Sequence of approval steps
-
IsActive: Whether workflow is active
-
ResourceFilters: Filters for which resources this applies to
Example
GET http://localhost/api/v1/Workflow/GetWorkflows
Example Response
[
{
"WorkflowId": "123e4567-e89b-12d3-a456-426614174000",
"Name": "IT Resource Approval",
"Description": "Standard approval workflow for IT resources",
"ApprovalSteps": [
{
"StepNumber": 1,
"ApproverType": "Manager",
"ApproverIdentifier": "DirectManager",
"IsRequired": true,
"AllowModification": false
},
{
"StepNumber": 2,
"ApproverType": "DataOwner",
"ApproverIdentifier": "ResourceOwner",
"IsRequired": true,
"AllowModification": true
}
],
"IsActive": true,
"ResourceFilters": [
{"ResourceType": "AD", "Pattern": "*"}
]
}
]
Insert Workflow (POST)
Creates a new workflow definition.
Route
|
URI |
/api/v1/Workflow/InsertWorkflow |
|
Method |
POST |
|
Result |
JSON – WorkflowCreationResult |
Request Payload
WorkflowModel object:
|
Property |
Type |
Mandatory |
Description |
|---|---|---|---|
|
Name |
string |
Yes |
Workflow name |
|
Description |
string |
No |
Workflow description |
|
ApprovalSteps |
ApprovalStepModel[] |
Yes |
Sequence of approval steps |
|
IsActive |
bool |
Yes |
Whether workflow is active |
|
ResourceFilters |
ResourceFilterModel[] |
No |
Filters for applicable resources |
Response Structure
WorkflowCreationResult containing:
-
WorkflowId: Guid of the created workflow
-
Success: Boolean indicating creation success
-
Message: Status or error message
Example Request
POST http://localhost/api/v1/Workflow/InsertWorkflow
Content-Type: application/json
{
"Name": "IT Resource Approval",
"Description": "Standard approval workflow for IT resources",
"ApprovalSteps": [
{
"StepNumber": 1,
"ApproverType": "Manager",
"ApproverIdentifier": "DirectManager",
"IsRequired": true,
"AllowModification": false
}
],
"IsActive": true,
"ResourceFilters": []
}
Example Response
{
"WorkflowId": "123e4567-e89b-12d3-a456-426614174000",
"Success": true,
"Message": "Workflow created successfully"
}
Update Workflow (PUT)
Updates an existing workflow definition.
Route
|
URI |
/api/v1/Workflow/UpdateWorkflow |
|
Method |
PUT |
|
Result |
JSON – WorkflowUpdateResult |
Request Payload
WorkflowModel object:
|
Property |
Type |
Mandatory |
Description |
|---|---|---|---|
|
WorkflowId |
Guid |
Yes |
Existing workflow identifier |
|
Name |
string |
Yes |
Workflow name |
|
Description |
string |
No |
Workflow description |
|
ApprovalSteps |
ApprovalStepModel[] |
Yes |
Sequence of approval steps |
|
IsActive |
bool |
Yes |
Whether workflow is active |
|
ResourceFilters |
ResourceFilterModel[] |
No |
Filters for applicable resources |
Response Structure
WorkflowUpdateResult containing:
-
Success: Boolean indicating update success
-
Message: Status or error message
Example Request
PUT http://localhost/api/v1/Workflow/UpdateWorkflow
Content-Type: application/json
{
"WorkflowId": "123e4567-e89b-12d3-a456-426614174000",
"Name": "Updated IT Resource Approval",
"Description": "Modified approval workflow",
"ApprovalSteps": [
{
"StepNumber": 1,
"ApproverType": "Manager",
"ApproverIdentifier": "DirectManager",
"IsRequired": true,
"AllowModification": false
}
],
"IsActive": true,
"ResourceFilters": []
}
Example Response
{
"Success": true,
"Message": "Workflow updated successfully"
}
Delete Workflow (DELETE)
Deletes a workflow definition.
Route
|
URI |
/api/v1/Workflow/DeleteWorkflow |
|
Method |
DELETE |
|
Result |
JSON – WorkflowDeletionResult |
Parameters
Workflow Identifier.
Example
DELETE http://localhost/api/v1/Workflow/DeleteWorkflow?workflowId=guid
{
"Success": true
}
Get Atomic Approvers (GET)
Returns atomic approval roles configuration.
Route
|
URI |
/api/v1/Workflow/AtomicApprovalRoles |
|
Method |
GET |
|
Result |
JSON – Array of AtomicApprovalRole |
Parameters
None
Example
GET http://localhost/api/v1/Workflow/AtomicApprovalRoles
[
{
"Type": "DataOwnerApprover",
"dataOwnerOrganizationId": null,
"dataOwnerOrganizationName": null,
"displayName": null,
"displayResourceName": "LegacyDataOwnerApprovalRoleDefinition_DisplayResourceName"
},
{
"Type": "AidManAdminApprover",
"displayResourceName": "AidManAdminApprover"
},
{
"Type": "ManagerApprover",
"displayResourceName": "ManagerApprover"
},
{
"Type": "DefinedByPreviousApprover",
"displayResourceName": "DefinedByPreviousApprover"
},
{
"Type": "DataOwnerOfResourceApprover",
"displayResourceName": "DataOwnerApprover"
}
]
Get Data Owners (GET)
Returns data owner approval roles.
Route
|
URI |
/api/v1/workflow/dataOwnerapprovalroles |
|
Method |
GET |
|
Result |
JSON – Array of DataOwnerApprovalRole |
Parameters
None
Example
GET http://localhost/api/v1/workflow/dataOwnerapprovalroles
[
{
"Type": "DataOwnerApprover",
"dataOwnerOrganizationId": "fc1f754b-b547-4bca-a722-da658a590627",
"dataOwnerOrganizationName": "Company Name",
"displayName": "Company Name",
"displayResourceName": "LegacyDataOwnerApprovalRoleDefinition_DisplayResourceName"
},
{
"Type": "DataOwnerApprover",
"dataOwnerOrganizationId": "72e0b15a-7944-4929-8d71-c0cae6aac493",
"dataOwnerOrganizationName": "ewaf",
"displayName": "ewaf",
"displayResourceName": "LegacyDataOwnerApprovalRoleDefinition_DisplayResourceName"
}
]
Is Approver Allowed To Modify Order (GET)
Checks if the current approver is allowed to modify an order.
Route
|
URI |
/api/v1/Workflow/IsApproverAllowedToModifyOrder |
|
Method |
GET |
|
Result |
JSON – bool |
Parameters
|
Name |
Type |
Mandatory |
Description |
|
orderId |
Guid |
Yes |
The order identifier |
Example
GET http://localhost/api/v1/Workflow/IsApproverAllowedToModifyOrder?orderId=guid
Get Order Configuration (GET)
Returns workflow order configuration settings.
Route
|
URI |
/api/v1/Workflow/Configuration |
|
Method |
GET |
|
Result |
JSON – OrderConfigurationModel |
Parameters
None
Example
GET http://localhost/api/v1/Workflow/Configuration
{
"Type": "Container",
"label": "Configuration",
"templates": [
{
"key": "BaseConfiguration",
"value": {
"Type": "CollapsibleContainer",
"isCollapsed": false,
"label": "General Settings",
"templates": [
{
"key": "grantMaAdminEmail",
"value": {
"Type": "TextField",
"postfixText": null,
"dynamicQuery": null,
"dynamicResultWasSet": false,
"isRequired": true,
"constraints": {
"$type": "pn.formTemplates.resourceTemplates.TextInputConstraints, pn.formTemplates",
"isDirty": false,
"creationRule": null,
"maxLength": 254,
"forbiddenChars": null,
"isRequired": true,
"validationRule": "^(?!\\.)(\"([^\"\\\\\\r]|\\\\[\"\\r\\\\])*\"|([-0-9$%&!#a-z'*+/=?^_`{|}~]|(?<!\\.)\\.)*)(?<!\\.)@[0-9a-z][\\w\\.-]*[0-9a-z]\\.[a-z][a-z\\.]*[a-z]$",
"validationInformation": "Email address not valid!",
"allowOnlyDefinedValues": false,
"definedValues": null,
"uniquenessConstraint": null
},
"summary": null,
"value": null,
"defaultValue": null,
"description": null,
"customError": null,
"allowApply": true,
"label": "The administrator email address for GrantMA is",
"isEnabled": true,
"isEnabledRule": null,
"parsedIsEnabledRule": null,
"customAttributes": null,
"isHidden": false,
"isVisibleRule": null,
"parsedIsVisibleRule": null
}
}
],
"summary": null,
"customAttributes": null,
"isHidden": false,
"isVisibleRule": null,
"parsedIsVisibleRule": null
}
}
],
"summary": null,
"customAttributes": null,
"isHidden": false,
"isVisibleRule": null,
"parsedIsVisibleRule": null
}