Configure Web API
- Last UpdatedJun 21, 2024
- 3 minute read
You can configure the Web APIs in the Web API Activity Configuration window. This window lists all the Web APIs configured for the application or workflow.
Http Method:
The Invoke Web API activity supports the following HTTP request methods:
-
GET: The GET method retrieves information from the given server using a given URI. Requests using GET should only retrieve data and should have no other effect on the data.
-
POST: A POST request sends data to the server, for example customer information, file upload, using HTML forms.
-
PUT: A PUT request replaces all current representations of the target resource with the uploaded content.
-
DELETE: A DELETE request removes all current representations of the target resource given by the URI.
Web API
Web APIs are frameworks to build HTTP services for browsers and mobile devices.
If the Web API is Windows authenticated, then the status of the Windows Authentication must be set to Enabled for the EnterpriseConsole site under AVEVAWorkTasksSites site in the IIS Manager.
If the Web API requires ArchestrA Security Token Service (ASTS) access token authentication, then the Workflow Engine Service must first be registered as a client in the ASTS server through Central Configuration site. Web API with the Access Token enabled Authentication gets listed in the Web API drop-down list, so that it can be used within the workflow.
Request URI
The Request URI is a Uniform Resource Identifier and identifies the resource upon which to apply the request.
Example:
-
Request URI without parameters: api/product/1 for http://localhost/MySite/api/product/1
-
Request URI with parameters: api/{product}/{ID} for http://localhost/MySite/api
Use System Authentication
Select the Use System Authentication check box to use the access token of the Workflow Engine Service.
Content Type
You can configure the content type of the Post Data. The available options are JSON, XML, and URL ENCODED.
This field is displayed only when the value of Http Method is set to POST or PUT.
POST Data
Passing data to POST and PUT Methods
You can pass data to POST and PUT methods either through parameters or through the request body. If you pass data through request body, use the adjacent text box for the body content. If web API method uses [FromBody] attribute, select the Yes option for the FromBody Attribute property.
Output Settings
Save output type
Use the options in this field to save the return value from the Web Method so that you can use it in subsequent activities. You can save the return value as either a Variable or as an XML Variable.
Save output in
To save the output as a Variable, select the variable that you created in the Start activity. To save the output as an XML Variable, select the XML Variable that you created in the Start activity. You can also create the XML Variable using the Create New option. For more information on creating XML Variable, see Create XML Variable.
When you create a new XML Variable for Web API, we suggest you give sample Web API with multiple child nodes. This will add ChildNode node to the XML Variable structure. If the sample Web API contains only one child node, it may not add the ChildNode node to the XML Variable structure, and the nodes may not get mapped properly in the workflow.
You can also overwrite the XML Variable using the Update XML Variable option after modifying the Web API configuration.