Skip to main content

CallSimplifiedAPI

Description

Calls a simplified M-Files API endpoint with the specified HTTP method.

NOTE: Stability is experimental. Non-backward compatible changes or removal may occur in any future release. Use of this feature is not recommended for production environments.

Syntax

// shellFrame points to instance of IShellFrame
const result = await shellFrame.CallSimplifiedAPI(
requestRelativeURL,
method,
payload,
);

Parameters

NameOptionalityTypeDescription
requestRelativeURLRequiredstringThe relative URL path of the API endpoint to call.
Must start with "/" and may include a query string,
but cannot include fragments, backslashes,
or traversal segments.
methodRequiredstringThe HTTP method to use. Only "GET", "POST", and "DELETE" are allowed.
payloadOptionalstringOptional JSON string to include as the request body (for POST requests).

Return type

TypeDescription
Promise < any >A promise that resolves to the parsed JSON response from the server,
or rejects with an error if the HTTP request fails or response parsing fails

Exceptions

NotSupportedError - when the CE3224_SimplifiedCoreAPISupportUIX2 feature flag is not enabled, or when called from a non-cloud vault.

Error - an error if the HTTP response status is not ok, if the request input is invalid, if the user session is unavailable, or if there is a network or parsing error