Please ensure Javascript is enabled for purposes of website accessibility
Powered by Zoomin Software. For more details please contactZoomin

AVEVA™ Work Tasks

Invoke Web API Activity

  • Last UpdatedJul 26, 2023
  • 2 minute read

Activity Description

You can use the Invoke Web API activity to invoke a web API from the workflow. Use the output of the activity to determine the path of workflow execution.

The output is triggered based on the http Status Code returned by the activity. Alternatively, the output Status Code can be saved in a AVEVA Work Tasks system variable.
The variable has to be prefixed with "^" followed by "Activity Name _StatusCode". For example, if the activity name is Invoke Web API1, then variable name should be "^Invoke Web API1_StatusCode" and the data type should be "string".

The Error Message can be saved in the AVEVA Work Tasks system variable.
The variable has to be prefixed with "^" followed by "Activity Name _WebAPIErrorMessage". For example, if the activity name is Invoke Web API1, then variable name should be "^Invoke Web API1_WebAPIErrorMessage" and the data type should be "string".

The additional error information (i.e. http custom content message) can be saved in the AVEVA Work Tasks system variable.
The variable has to be prefixed with "^" followed by "Activity Name _WebAPIErrorDetails". For example, if the activity name is Invoke Web API1, then variable name should be "^Invoke Web API1_WebAPIErrorDetails" and the data type should be "string".

You can use any HTTP client to invoke your web API. In fact, you can invoke it directly from a web browser. When the Web API framework receives a request, it routes the request to an action. To determine which action to invoke, the framework uses a routing table.

Activity Properties

You can configure the Invoke Web API activity by specifying appropriate values in the Activity Properties area. To access the Activity Properties, click the Activity Properties menu in the Tool Bar. Or, right-click the Invoke Web API activity and select the Activity Properties option. The Activity properties are organized under groups of related properties. The properties under each group are described in this topic.

Name & Description

Use the Name and Description properties to enter the the name and description for the activity. This property is optional, and can be set if required.

  • Name: Specify a name for the activity.

  • Description: Specifies a brief description to be displayed for the activity.

Configuration

Use the configuration properties to configure the functionality of the activity.

Configure Web API: Use this property to configure the Web API to be called. Web APIs are frameworks to build HTTP services for browsers and mobile devices.

For more information about this activity property, see Invoke Web API: Configure Web API.

Looping Behavior

Use this property to specify the looping behavior of the activity. This property is optional, and can be set if required.

Loop through this action if output is: Specify the condition for looping the activity. Select any one of the following activities from the list:

  • No Loop

  • BadGateway(502)

  • BadRequest(400)

  • Error Encountered

  • Forbidden(403)

  • GatewayTimeout(504)

  • HttpVersionNotSupported(505)

  • InternalServerError(500)

  • MethodNotAllowed(405)

  • NotAcceptable(406)

  • NotFound(404)

  • NotImplemented(501)

  • ProxyAuthenticationRequired(407)

  • RequestTimeout(408)

  • ServiceUnavailable(503)

  • Successful

  • Unauthorized(401)

  • Unsuccessful

  • UnsupportedMediaType(415)

Note: For the Invoke Web API activity, the StatusCodes "OK(200)" and 'ConnectFailure(0)' is not saved in the system variable (i.e. "^Activity Name_StatusCode").

TitleResults for “How to create a CRG?”Also Available in