Skip to main content

BaseRequest

Stentor API Reference


Stentor API Reference / stentor-models/src / BaseRequest

Interface: BaseRequest

Defined in: packages/stentor-models/src/Request/Request.ts:26

Shared parameters for each Request

Extended by​

Properties​

type​

type: RequestTypes

Defined in: packages/stentor-models/src/Request/Request.ts:30

Type of the request.


overrideKey?​

optional overrideKey: string

Defined in: packages/stentor-models/src/Request/Request.ts:35

Used during forwarding and redirecting the request to another handler. When set it pulls content or paths for this key instead of for the request.


createdTime?​

optional createdTime: string

Defined in: packages/stentor-models/src/Request/Request.ts:39

When the message was created, an ISO-8601 compatible date time string


userId​

userId: string

Defined in: packages/stentor-models/src/Request/Request.ts:43

ID for the user making the request.


deviceId?​

optional deviceId: string

Defined in: packages/stentor-models/src/Request/Request.ts:47

Unique identifier provided by the channel for the user's current device.


requestId?​

optional requestId: string

Defined in: packages/stentor-models/src/Request/Request.ts:51

Optional unique identifier for the request provided by the channel.


anonymous?​

optional anonymous: boolean

Defined in: packages/stentor-models/src/Request/Request.ts:58

The user is anonymous, or a guest.

The user either does not yet have a verified identity or have chosen to not have any data saved about them.


isNewSession?​

optional isNewSession: boolean

Defined in: packages/stentor-models/src/Request/Request.ts:62

Is the request a new session.


accessToken?​

optional accessToken: string

Defined in: packages/stentor-models/src/Request/Request.ts:66

Access token from account linking


apiAccess?​

optional apiAccess: ApiAccessData

Defined in: packages/stentor-models/src/Request/Request.ts:71

API access data from the platform In case there is an APIs that provides services like list management, messaging...


rawQuery?​

optional rawQuery: string

Defined in: packages/stentor-models/src/Request/Request.ts:75

Raw speech to text (STT) query, not available on all platforms.


platform?​

optional platform: string

Defined in: packages/stentor-models/src/Request/Request.ts:82

The platform the request came from.

Example platforms are Google's Dialogflow & Amazon's Lex.


channel?​

optional channel: string

Defined in: packages/stentor-models/src/Request/Request.ts:86

The specific channel that the platform provides.


device?​

optional device: Device

Defined in: packages/stentor-models/src/Request/Request.ts:93

Information about the device as far as capabilities such as screen or web browser available.

This information is available in two places, also on the context object, until it is removed from the context in the next major release.


locale?​

optional locale: Locale

Defined in: packages/stentor-models/src/Request/Request.ts:100

User's locale, such as us-EN and es-MX.

Possible values for Alexa are defined here: https://developer.amazon.com/docs/custom-skills/request-and-response-json-reference.html#request-locale Possible values for Dialogflow are defined here: https://dialogflow.com/docs/reference/language


isBargeIn?​

optional isBargeIn: boolean

Defined in: packages/stentor-models/src/Request/Request.ts:106

Is the request a barge in

Currently only set on Google and Dialogflow request


isHealthCheck?​

optional isHealthCheck: boolean

Defined in: packages/stentor-models/src/Request/Request.ts:112

Is the request a health check.

Currently only Google and Dialogflow perform health checks.


attributes?​

optional attributes: Record\<string, unknown>

Defined in: packages/stentor-models/src/Request/Request.ts:125

Optional request attributes to be passed through on the request.

If the channel supports it, it will be populated.

Some common keys that are use are, all optional:

  • currentUrl - For channels installed on websites, contains window.location.href information on where the user is
  • isLocal - Boolean for if the currentUrl is to localhost. If it is true then most likely currentUrl will be undefined.
  • environment - Used to override the environment