CallAction
Calls an internal endpoint set up on the FintechOS platform. This allows you to access internal methods and functions through the API.
Syntax
Copy
POST <<i>host_address</i>>api/openApi/CallAction/[?culture=<localization>]
Content-Type: application/json
{
"ApiInfo": {
"Token": <<i>access_token</i>>
},
"Request": {
<"ActionName"|"ActionID">: <<i>endpoint_name</i>|<i>endpoint_id</i>>
[,"Data": {<input_parameters>}]
}
}
| Parameter | Description |
|---|---|
host_address
|
URL of the FintechOS platform server. |
access_token
|
Access token used to connect to the API endpoint. For details, see GetToken. |
endpoint_name
|
Name of the endpoint you wish to access on the FintechOS platform. To be used in conjunction with the ActionName parameter. |
endpoint_id
|
ID of the endpoint you wish to access on the FintechOS platform. To be used in conjunction with the ActionID parameter. FintechOS recommends using the ActionName parameter when calling an internal endpoint. The ActionID parameter is provided mostly for backward compatibility. |
input_parameters
|
Key-value pairs of any input parameters to be passed to the internal endpoint in JSON format. Double quotes that enclose string parameter values must be escaped with backslash characters, e.g.: \"string value\". |
culture
|
Optional parameter used to set the localization context for the server-side script behind the endpoint, e.g. "?culture=ro-RO". When the script is triggered, this applies the corresponding localization values to the ebsResource objects within the script. |
Response
The response indicates the result of the code execution, depending on the endpoint's function.
Examples
In this example:
- An endpoint called messenger is set up on the FintechOS server. The endpoint runs the following automation script (which uses the
setMessageandloginternal methods)://read the message
var a = context.Data.entry;
//write the message
setMessage(a, true);
//log the message
log(a)
- The message's content (Good job) is passed to the automation script parameter through the entry parameter.
- The server's address is https://FintechOSStudio.
- The access token used to connect to the API endpoint is e9735b2a-b5f8-461a-9fec-a819a071a2ff. For information on how to obtain the access token, see GetToken.
- The response indicates that the "Good job" message was displayed ("Message": "Good job") and that no navigation was triggered in the user interface.
- The message was also logged in the server's trace file with the following entry:
-[START]---------------------------------------
Timestamp: 9/12/2019 3:30:18 PM
Message: INFO [CID=9a86315f-caaa-4547-b2eb-28270b2a4a68] Good job
Severity: Information
-[END]---------------------------------------
Request
Copy
POST https://FintechOSStudio/api/openApi/CallAction
Content-Type: application/json
{
"ApiInfo": {
"Token": e9735b2a-b5f8-461a-9fec-a819a071a2ff
},
"Request": {
"ActionName": "messenger",
"Data": "{entry: \"Good job\"}"
}
}
Response
Copy
{
"UIResult": {
"NavigateToEntityPage": false,
"NavigateToEntityPageOnEdit": false,
"NavigateToEntityFormName": null,
"NavigateToEntityName": null,
"NavigateToEntityId": null,
"NavigateToEntityInsertDefaults": null,
"NavigateToUrl": null,
"DownloadFile": null,
"ReloadPage": false,
"Message": "Good job",
"IsSuccess": true,
"Data": null,
"NavigateToPageNo": null
},
"Message": null,
"IsSuccess": true,
"ClientScript": null,
"Serialized": null,
"ErrorCode": 0
}