How to execute Action/Group through the REST api

This article demonstrate how to work with the Flexi Kanban application thought the REST api.

The application supports only POST REST api calls of internal APEX classes. The one of those classes is the class "KanBanActionService". This class is responsible for working with Actions or Action Groups.

Basic REST api information

The endpoint must look like:

https://{ORG_DOMAIN}/services/apexrest/FLX_KB/kanban_api

The headers must look like:

Authorization: Bearer {APEX_SESSION_ID}
Content-Type: application/json; charset=UTF-8
Accept: application/json

The body must look like:

{
"className": "KanBanActionService",Β 
"methodName": "executeActionOrGroup", Β 
"parameters": "{\"actionOrGroupId\":\"{ACTION_OR_GROUP_ID}\",\"source\":\"{SOURCE_OBJECT}\",\"variables\":{VARIABLES_IN_JSON_FORMAT}}",
"parametersType": "json"Β 
}

Where:

  • className - the class name that contains the method you are going to execute.

  • methodName - the method name that you are going to execute.

  • parameters - the parameters in string format.

  • parametersType - the type of parameters. Supports: json, string, integer, decimal, date, datetime, boolean.

The above example demonstrates how the body should look like, in case of executing Action or Action Group.

The "parameters" contains the JSON object, where:

  • actionOrGroupId - the ID of the Action or Action Group. Required.

  • source - the source of the Action or Action Group. Optional.

  • variables - the variables in JSON key/value format. Optional.

Executing "Validation Rule" action

The Action with "Validation Rule" type.

The REST api request in this case.

Executing "Define Variable" action

The Action with "Define Variable" type.

The REST api request in this case.

Last updated