Skip to main content

ManagedAPIService API

ManagedAPIService provides access to Managed APIs, which are configurations for external APIs that can be consumed with scripts or native. Managed APIs store credentials and access details securely.

To access ManagedAPIService functions; get its instance from DataSapien object: DataSapien.getManagedAPIService().

Functions (JavaScript)

Public functions

Void

ManagedApiService.syncManagedAPIs()

Synchronizes Managed APIs metadata with the Orchestrator.

Parameters

  • None.

Promise <DataMap[]>

ManagedApiService.getManagedAPIs()

Retrieves all Managed APIs stored on the device.

Parameters

  • None.

Promise <DataMap | null>

ManagedApiService.getManagedAPI(
name: string
)

Retrieves a single Managed API definition by its programmatic name.

Parameters

  • name: string - Programmatic name of the Managed API.

Promise <string>

ManagedApiService.startOAuth(
authUrl: string,
redirectUri: string,
queryName: string
)

Starts an OAuth authentication flow and returns the authorization code extracted from the redirect URL.

Parameters

  • authUrl: string - OAuth authorization endpoint.
  • redirectUri: string - Redirect URI configured for your OAuth client.
  • queryName: string - Query parameter key used to extract the authorization code.

Promise <string>

ManagedApiService.fetchTokenFromCode(
tokenUrl: string,
httpMethod: "GET" | "POST"
)

Exchanges an OAuth authorization code for an access token.

Parameters

  • tokenUrl: string - Token endpoint URL.
  • httpMethod: "GET" | "POST" - HTTP method to use for token exchange.

Classes (JavaScript)

DataMap (JavaScript)

{ [key: string]: string }