Update Request

Updates an existing request waiting for a user input to progress and proceed to the next task of the workflow. This is applicable only for tasks that need manual intervention. For example, Form task.

Before you begin

Before attempting to submit a request with this API, you must ensure that the following permissions are available:
  • Service Requests > Action > View all requests
  • Service Requests > Action > View my requests
You can check this in the Platform module under IDENTITY > Role > Authorized functions.

Request Structure

Endpoint: /visualworkflow-update-request
Type: POST
Sample URL: https://<IP/HostName/TenantName>:<GWPORT>/avxapi/visualworkflow-update-request?gwsource=external

To understand the elements of the sample URL, click here.

Headers:
Content-Type: application/json
Table 1. Input Parameters
Name Description
sessionID

Header

(Mandatory) Use session ID retrieved from login API is required if username and password are not provided.

Example: "sessionId": "ce7f1a14-2bf9-4e4a-89a8-bc780a255813"

username

Header

(Mandatory) AppViewX login username is required if sessionId is not provided.

Example: "admin"

password

Header

(Mandatory) AppViewX login password is required if sessionId is not provided..

Example: "AppViewX@123"

Content-Type

Header

(Mandatory) The parameter should be set to application/json to specify the nature of the data in the payload.

Example: "application/json"

gwsource

Query

(Mandatory) Source from which the request is triggered. The values can be:
  • web
  • external
Payload

String

(Mandatory) Input data for request body in application/json format. For payload details, see Payload section.

Payload

Name Description
Header Payload
request_id

String

(Mandatory) The request ID to update the request details.

Example: "409"

workorder_id

String

(Mandatory) The workorder ID to update the request details.

Constraints: If there is no workorder in the workflow then the default value will be zero (0).

Example: "1"

task_id

String

(Mandatory) The task ID which will be updated.

Example: "reviewComponent_1"

Data Payload
input

Data Payload

(Mandatory) The input data for the user task.

Type: String

task_action

Data Payload

(Mandatory) Action to be performed on the task.

Type: Integer

Constraints: 1 for success case and 2 for reject case.

Example: "1"

Input Payload
config

Review Task Payload

(Mandatory) The prevalidation, implementation, post validation, and rollback configuration for the devices.

Type: Object

gridData

Grid Task Payload

(Mandatory) The grid configuration to be updated in the task.

Type: Object

Task Specific Information

Sample Request/Response - Review Task

Use Case

Update a request with a Review task.

Request URL
https://<IP/HostName/TenantName>:<GWPORT>/avxapi/visualworkflow-update-request?gwsource=external
Request Payload
{
  "payload": {
    "header": {
	  "request_id": "936",
      	  "workorder_id": "0",
      	  "task_id" : "reviewComponent_1"
    },
    "data":{
    	"input" : {"config": {
    "implement": {
      "deviceList": [
        {
          "deviceName": "192.168.41.101",
          "commands": [
            {
              "command": "<push></push>",
              "deviceName": "",
              "uniqueNumber": 2,
              "sequenceNumber": 0,
              "properties": {
                "sleep": 0
              },
              "type": "push"
            }
          ]
        }
      ]
    },
    "prevalidation": {
      "deviceList": [
        {
          "deviceName": "192.168.41.101",
          "commands": [
            {
              "command": "<push></push>",
              "deviceName": "",
              "uniqueNumber": 2,
              "sequenceNumber": 0,
              "properties": {
                "sleep": 0
              },
              "type": "push"
            }
          ]
        }
      ]
    },
    "postvalidation": {
      "deviceList": [
        {
          "deviceName": "192.168.41.101",
          "commands": [
            {
              "command": "<push></push>",
              "deviceName": "",
              "uniqueNumber": 2,
              "sequenceNumber": 0,
              "properties": {
                "sleep": 0
              },
              "type": "push"
            }
          ]
        }
      ]
    }
  }
  },
    		
    	"task_action":1
    }
  }
}
Sample Response
{
  "response": {
    "message": "Request submitted to workflow engine for processing workflow request 936",
    "requestId": "936"
  },
  "message": null,
  "appStatusCode": null,
  "tags": null
}

Sample Request/Response - Review Task within a Subflow

Use Case

Update a request with a review palette, where the Review task is within a subflow.

Request URL
https://<IP/HostName/TenantName>:<GWPORT>/avxapi/visualworkflow-update-request?gwsource=external
Request Payload
{
  "payload": {
    "header": {
	  "request_id": "936",
      	  "workorder_id": "0",
      	  "task_id" : "reviewComponent_1#subflowid"
    },
    "data":{
    	"input" : {"config": {
    "implement": {
      "deviceList": [
        {
          "deviceName": "192.168.41.101",
          "commands": [
            {
              "command": "<push></push>",
              "deviceName": "",
              "uniqueNumber": 2,
              "sequenceNumber": 0,
              "properties": {
                "sleep": 0
              },
              "type": "push"
            }
          ]
        }
      ]
    },
    "prevalidation": {
      "deviceList": [
        {
          "deviceName": "192.168.41.101",
          "commands": [
            {
              "command": "<push></push>",
              "deviceName": "",
              "uniqueNumber": 2,
              "sequenceNumber": 0,
              "properties": {
                "sleep": 0
              },
              "type": "push"
            }
          ]
        }
      ]
    },
    "postvalidation": {
      "deviceList": [
        {
          "deviceName": "192.168.41.101",
          "commands": [
            {
              "command": "<push></push>",
              "deviceName": "",
              "uniqueNumber": 2,
              "sequenceNumber": 0,
              "properties": {
                "sleep": 0
              },
              "type": "push"
            }
          ]
        }
      ]
    }
  }
  },
    		
    	"task_action":1
    }
  }
}
Sample Response
{
  "response": {
    "message": "Request submitted to workflow engine for processing workflow request 936",
    "requestId": "936"
  },
  "message": null,
  "appStatusCode": null,
  "tags": null
}

Grid Task Payload

Service tasks will not have any user input for submitting the request.

Sample Request/Response - Grid Task

Use Case

Update a request with a Grid task.

Request URL
https://<IP/HostName/TenantName>:<GWPORT>/avxapi/visualworkflow-update-request?gwsource=external
Request Payload
{
  "payload": {
	"header": {
  	"request_id": "937",
  	"workorder_id": "0",
  	"task_id": "gridComponent_1"
	},
	"data": {
  	"input": {
    	"gridData": [
      	{
        	"name": "Appviewx",
        	"designation": "Network"
      	},
      	{
        	"name": "ADC",
        	"designation": "Device"
      	}
    	]
  	},
  	"task_action": 1
	}
  }
Sample Response
{
  "response": {
    "message": "Request submitted to workflow engine for processing workflow request 936",
    "requestId": "936"
  },
  "message": null,
  "appStatusCode": null,
  "tags": null
}

Response Structure

  • Status Code: 200 OK
  • Message: Success
  • Headers:
    • Content-Type: application/json
Table 2. Response Parameters
Name Description
response

Key value pair

Contains the response params for the search object request.
message

String

Success message or failure description in case of error.
appStatusCode

String

Application specific status code for the response, will be non-null for failure response.
tags

NA

More info in case of failure response.
requestId

String

Unique identifier for the request.
message

String

The message with the status and request number for the request.

Status Codes

HTTP Status Code appStatusCode Message and Remediation
200 OK NA Success
400 Bad request avx-common-028 Invalid/Incorrect payload.

Possible Remediation: Check and ensure if a valid value is given in request payload field - input.

404 Not Found engine-db-011 Request not found.

Possible Remediation: Invalid workflow data.

500 Internal Server Error WORKFLOW_1056 Workflow request already closed.

Possible Remediation: Ensure workflow is not closed.

500 Internal Server Error NA Internal Server Error.
Possible Remediation:
  • Task is already completed.
  • Task is being processed by another user.
  • Service Request is paused.
  • Service Request has been aborted.
  • Service request is closed.
  • Given task is not the right task to be executed with Id.

Reference

Understanding the sample URL
  • IP/HostName/TenantName: Replace with the actual IP address, hostname, or tenant name based on the specific configuration in AppViewX.
    • IP: A unique identifier assigned to each device connected to a computer network that uses the Internet Protocol for communication

      The IP address will be included in the endpoint URL for an on-prem deployment.

    • HostName: A human-readable label assigned to a device (host) on a network

      The hostname will be included in the endpoint URL for an on-prem deployment.

    • TenantName: An identifier label for a tenant given to indicate which tenant's data the API request will access/modify

      The tenant name will be included in the endpoint URL for a SaaS deployment.

  • GWPORT: AppViewX gateway port

    A gateway port refers to a network port through which data is sent and received to communicate with a gateway in an on-prem deployment.

    Example: 31443

  • avxapi: Path parameter value (static) that is part of the endpoint's URL
  • Endpoint: Endpoint of the API, for example: execute-hook
  • gwsource: Source or origin of a gateway, for example: external.