Disclaimer: This website requires Please enable JavaScript in your browser settings for the best experience.

Dev Guide
Dev GuideUser GuidesGitHubDev CommunityOptimizely AcademySubmit a ticketLog In
Dev Guide

FunctionApi

OCP App SDK


OCP App SDK / FunctionApi

Interface: FunctionApi

Defined in: src/functions/FunctionApi.ts:16

Provides access to function endpoint urls

Methods

getAuthorizationGrantUrl()

getAuthorizationGrantUrl(): string

Defined in: src/functions/FunctionApi.ts:40

Retrieves the base url for an authorization grant. This can be used as the returning redirect url for an OAuth
request to an external service. The url does not contain a trailing slash.

Returns

string

authorization grant url


getEndpoints()

getEndpoints(installId?): Promise<FunctionEndpoints>

Defined in: src/functions/FunctionApi.ts:24

Retrieves the current set of available function endpoints urls. The urls do not contain a trailing slash.

Parameters

installId?

number

the id of the install to look up, defaults to current install.
Note: From global functions, installId must be provided. For other uses it should be left undefined.

Returns

Promise<FunctionEndpoints>

hash of function name to endpoint url


getGlobalEndpoints()

getGlobalEndpoints(): Promise<FunctionEndpoints>

Defined in: src/functions/FunctionApi.ts:32

Retrieves the set of available global function endpoints urls for this app.
The urls do not contain a trailing slash.

Returns

Promise<FunctionEndpoints>

hash of function name to endpoint url