Skip to main content

RunExtensionMethod

Runs the specified vault extension method. Prefer this method over 'ExecuteExtensionMethod' and 'ExecuteExtensionMethodEx' methods.

Syntax

// Assumes shellUI has been initialized with IShellUI instance
const results =
await shellUI.Vault.VaultExtensionMethodsOperations.RunExtensionMethod({
method_name: "<method_name>",
input: "<input>",
});

Message

There are two different use cases for calling extension methods, each requiring different parameters.

Use Case 1: VBScript/VAF Extension Methods

Use this when calling VBScript event handlers or VAF application methods.

NameDescriptionType
method_nameThe event handler name of the VaultExtensionMethod handler that receives the call.string
inputThe method input as clear text. Use empty string if compressed_input is used instead.string
compressed_inputOptional. Can be used instead of input to avoid size limits or inefficiencies with large data.Uint8Array
// VBScript/VAF Extension Method call
const results =
await shellUI.Vault.VaultExtensionMethodsOperations.RunExtensionMethod({
method_name: "<method_name>",
input: "<input>",
});

Use Case 2: IML Application Methods

Use this when calling methods exposed by IML applications and their services.

NameDescriptionType
application_idThe GUID of the target IML application (from the application definition file).string
extensionThe GUID of the IML service that the application exposes.string
instanceThe ID of the service instance. Leave empty to interact with the service directly. Services generate instance IDs (typically GUIDs) for each configured instance.string
method_nameThe name of the method that the service or instance exposes.string
inputThe data for the method as clear text. Use empty string if compressed_input is used instead.string
compressed_inputOptional. Can be used instead of input to avoid size limits or inefficiencies with large data.Uint8Array
// IML Application Method call
const results =
await shellUI.Vault.VaultExtensionMethodsOperations.RunExtensionMethod({
application_id: "<application_guid>",
extension: "<service_guid>",
instance: "<instance_id>", // Leave empty for service-level calls
method_name: "<method_name>",
input: "<input>",
});

Return type

NameDescriptionType
outputThe method output as a clear text. Empty string if compressed output field is used instead.string
compressed_outputThe method input as compressed data (utf8 text as zlib-compressed byte array). Empty data if the clear-text output was used.Uint8Array

Example

{
"output": "<output>",
"compressed_output": 0 /*Uint8Array*/
}