How to use Constants within API Calls
Create a new entity attribute to be used during an API function call.
Value-added: Through a GUI, create a user-defined constant that can be used for filling in a parameter in an API function call .
From our report, we can modify it to have a field that we could use for parameter mappings.
Go to the Query Entities & Attributes report for the Client/Server entity within the ACCESS RULES VIOLATIONS domain. Double-click on a row and select the Invoke... option.
Invoke the API function create_constant_attribute.
Fill in the constant value to use ('SCOTT'), fill in the attributeLabel you like to name it ('OracleTopParent'), and then click on the Invoke now button to create the constant.
Clicking on the Invoke now button will produce a API Call Output status showing the constant was created.
A re-display of the Query Entities & Attributes report will show the new attribute created.
The newly create constant can now be mapped for the report. Double-click on the new row and select the Invoke... option.
- Select the create_api_parameter_mapping option.
Fill in the functionName and the parameterName and click on the Invoke now button.
The newly created attribute must be added to the report. Edit the query through Query Builder and add the field.
Now when the report is displayed the new attribute is displayed.
To validate the new constant's usage, double-click on a row and select the Invoke... option.
Select the API function
Now the parentUserName is populated from the newly added constant. Click the Invoke now button.
Validate the new Data Security User Hierarchy.