Dev Guide
Dev GuideUser GuidesLegal TermsGitHubDevCommunityOptimizely AcademySubmit a ticketLog In
Dev Guide

ODP Node SDK / ODP / ApiV3 / API

API

Index

Constructors

Methods

Constructors

constructor()

Signature

new API(config: null | Config | InternalConfig): API;

Parameters

NameType
confignull | Config | InternalConfig

Returns

API

Defined in: src/Api/lib/ApiV3.ts:105

Methods

errorForCode()

Signature

errorForCode(code: ErrorCode): HttpError;

Parameters

NameType
codeErrorCode

Returns

HttpError

Defined in: src/Api/lib/ApiV3.ts:121

get()

Signature

get<T>(path: string): Promise<HttpResponse<T>>;

Type parameters

Parameters

NameType
pathstring

Returns

Promise<HttpResponse<T>>

Defined in: src/Api/lib/ApiV3.ts:123

getContext()

Signature

getContext(): undefined | AppContext;

Returns

undefined | AppContext

Defined in: src/Api/lib/ApiV3.ts:219

post()

Signature

post<T>(path: string, payload: Payload): Promise<HttpResponse<T>>;

Type parameters

Parameters

NameType
pathstring
payloadPayload

Returns

Promise<HttpResponse<T>>

Defined in: src/Api/lib/ApiV3.ts:125

request()

Signature

request<T>(
  method: HttpMethod,
  path: string,
  payload: undefined | Payload,
  options: RequestOptions = ...): Promise<HttpResponse<T>>;

Type parameters

Parameters

NameType
methodHttpMethod
pathstring
payloadundefined | Payload
optionsRequestOptions

Returns

Promise<HttpResponse<T>>

Defined in: src/Api/lib/ApiV3.ts:127