# ExposedApi.ExposedApi

[Embedding API Reference](https://docs.roomle.com/rubens/rubens-products/rubens-products-reference) / [Modules](https://docs.roomle.com/rubens/rubens-products/rubens-products-reference/modules) / [exposed-api](https://docs.roomle.com/rubens/rubens-products/rubens-products-reference/modules/exposed_api) / ExposedApi

## Class: ExposedApi

[exposed-api](https://docs.roomle.com/rubens/rubens-products/rubens-products-reference/modules/exposed_api).ExposedApi

### Table of contents

#### Constructors

* [constructor](#constructor)

#### Accessors

* [callbacks](#callbacks)

#### Methods

* [activateCustomView](#activatecustomview)
* [activateRoomDesigner](#activateroomdesigner)
* [closePopUp](#closepopup)
* [deactivateCustomView](#deactivatecustomview)
* [deactivateRoomDesigner](#deactivateroomdesigner)
* [disableEvents](#disableevents)
* [dragInObject](#draginobject)
* [dragInObjectEnd](#draginobjectend)
* [enableEvents](#enableevents)
* [getBoundingClientRect](#getboundingclientrect)
* [getDrawerAnimation](#getdraweranimation)
* [getDrawerBoundingClientRect](#getdrawerboundingclientrect)
* [getPartListPdf](#getpartlistpdf)
* [getPopUpShadowStyle](#getpopupshadowstyle)
* [giveGaConsent](#givegaconsent)
* [insertObject](#insertobject)
* [loadConfigurationString](#loadconfigurationstring)
* [loadObject](#loadobject)
* [pauseConfiguring](#pauseconfiguring)
* [setActiveParameterGroup](#setactiveparametergroup)
* [setPrice](#setprice)
* [startConfiguring](#startconfiguring)
* [toggleDrawer](#toggledrawer)
* [triggerRequestPlan](#triggerrequestplan)
* [triggerRequestProduct](#triggerrequestproduct)
* [triggerSaveDraft](#triggersavedraft)
* [triggerShowOverlay](#triggershowoverlay)
* [updateDrag](#updatedrag)

### Constructors

#### constructor

• **new ExposedApi**(`sdkConnector`, `mainMessageHandlers`, `sdk`, `exposedCallbacks`, `store`, `analytics`, `globalCallback`, `intl`, `libs`, `eventEmitter`, `rapiAccess`): [`ExposedApi`](https://docs.roomle.com/rubens/rubens-products/rubens-products-reference/classes/exposed_api.exposedapi)

**Parameters**

| Name                  | Type                                                                                                                                                                                                                                                                                  |
| --------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `sdkConnector`        | [`SdkConnector`](https://docs.roomle.com/rubens/rubens-products/rubens-products-reference/classes/exposed_api._internal_.sdkconnector)                                                                                                                                                |
| `mainMessageHandlers` | [`Nullable`](https://docs.roomle.com/rubens/rubens-products/modules/exposed_api._internal_#nullable)<[`MessageHandler`](https://docs.roomle.com/rubens/rubens-products/rubens-products-reference/classes/exposed_api._internal_.messagehandler)>                                      |
| `sdk`                 | [`RoomlePlannerWithExtObjs`](https://docs.roomle.com/rubens/rubens-products/modules/exposed_api._internal_#roomleplannerwithextobjs) \| [`RoomleConfiguratorType`](https://docs.roomle.com/rubens/rubens-products/modules/exposed_api._internal_#roomleconfiguratortype) \| `default` |
| `exposedCallbacks`    | [`ExposedCallbacks`](https://docs.roomle.com/rubens/rubens-products/rubens-products-reference/classes/exposed_callbacks.exposedcallbacks)                                                                                                                                             |
| `store`               | `Store`<[`StoreState`](https://docs.roomle.com/rubens/rubens-products/rubens-products-reference/interfaces/exposed_api._internal_.storestate)>                                                                                                                                        |
| `analytics`           | [`Analytics`](https://docs.roomle.com/rubens/rubens-products/rubens-products-reference/interfaces/exposed_api._internal_.analytics)                                                                                                                                                   |
| `globalCallback`      | `GlobalCallback`                                                                                                                                                                                                                                                                      |
| `intl`                | [`Translator`](https://docs.roomle.com/rubens/rubens-products/rubens-products-reference/interfaces/exposed_api._internal_.translator)                                                                                                                                                 |
| `libs`                | [`Libs`](https://docs.roomle.com/rubens/rubens-products/rubens-products-reference/classes/exposed_api._internal_.libs)                                                                                                                                                                |
| `eventEmitter`        | [`default`](https://docs.roomle.com/rubens/rubens-products/rubens-products-reference/classes/exposed_api._internal_.default)                                                                                                                                                          |
| `rapiAccess`          | `default`                                                                                                                                                                                                                                                                             |

**Returns**

[`ExposedApi`](https://docs.roomle.com/rubens/rubens-products/rubens-products-reference/classes/exposed_api.exposedapi)

### Accessors

#### callbacks

• `get` **callbacks**(): [`ExposedCallbacks`](https://docs.roomle.com/rubens/rubens-products/rubens-products-reference/classes/exposed_callbacks.exposedcallbacks)

**Returns**

[`ExposedCallbacks`](https://docs.roomle.com/rubens/rubens-products/rubens-products-reference/classes/exposed_callbacks.exposedcallbacks)

### Methods

#### activateCustomView

▸ **activateCustomView**(`viewName`, `options`): `void`

**Parameters**

| Name       | Type                                                                                                                                                          |
| ---------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `viewName` | keyof [`CustomViews`](https://docs.roomle.com/rubens/rubens-products/rubens-products-reference/interfaces/types.customviews)                                  |
| `options`  | [`CustomViewSettingsForIframe`](https://docs.roomle.com/rubens/rubens-products/rubens-products-reference/interfaces/types.customviewsettingsforiframe)<`any`> |

**Returns**

`void`

***

#### activateRoomDesigner

▸ **activateRoomDesigner**(): `void`

**Returns**

`void`

***

#### closePopUp

▸ **closePopUp**(): `void`

**Returns**

`void`

***

#### deactivateCustomView

▸ **deactivateCustomView**(`viewName`, `options`): `void`

**Parameters**

| Name       | Type                                                                                                                                                          |
| ---------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `viewName` | keyof [`CustomViews`](https://docs.roomle.com/rubens/rubens-products/rubens-products-reference/interfaces/types.customviews)                                  |
| `options`  | [`CustomViewSettingsForIframe`](https://docs.roomle.com/rubens/rubens-products/rubens-products-reference/interfaces/types.customviewsettingsforiframe)<`any`> |

**Returns**

`void`

***

#### deactivateRoomDesigner

▸ **deactivateRoomDesigner**(): `void`

**Returns**

`void`

***

#### disableEvents

▸ **disableEvents**(): `void`

**Returns**

`void`

***

#### dragInObject

▸ **dragInObject**(`id`, `x`, `y`, `type?`): `Promise`<`number`>

Use this to start a drag in of an object the coordinates x and y are relative to the iframe. Meaning 0/0 is the top left corner of the iframe

**Parameters**

| Name   | Type     | Default value | Description                                                                                                                                                                                                                                                                     |
| ------ | -------- | ------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `id`   | `string` | `undefined`   | Roomle ID of the object that should be inserted and dragged                                                                                                                                                                                                                     |
| `x`    | `number` | `undefined`   | coordinate of the drag event                                                                                                                                                                                                                                                    |
| `y`    | `number` | `undefined`   | coordinate of the drag event                                                                                                                                                                                                                                                    |
| `type` | `string` | `'rml_id'`    | type of the id, default is 'rml\_id' for example: usm:frame, 'rml\_serialized' for serialized configurations like {"componentId": "usm:frame"} (currently not supported), 'tc\_serialized' for serialized TecConfig Object, 'tc\_id' for TecConfig ID (currently not supported) |

**Returns**

`Promise`<`number`>

number runtimeId of the dragged object

***

#### dragInObjectEnd

▸ **dragInObjectEnd**(): `void`

Call this method when the drag ends

**Returns**

`void`

***

#### enableEvents

▸ **enableEvents**(): `void`

**Returns**

`void`

***

#### getBoundingClientRect

▸ **getBoundingClientRect**(`selector`): `DOMRect`

**Parameters**

| Name       | Type     |
| ---------- | -------- |
| `selector` | `string` |

**Returns**

`DOMRect`

***

#### getDrawerAnimation

▸ **getDrawerAnimation**(): `Object`

**Returns**

`Object`

| Name         | Type     |
| ------------ | -------- |
| `direction`  | `string` |
| `transition` | `string` |

***

#### getDrawerBoundingClientRect

▸ **getDrawerBoundingClientRect**(): `Promise`<{ `actual`: `DOMRect` ; `final`: `DOMRect` }>

**Returns**

`Promise`<{ `actual`: `DOMRect` ; `final`: `DOMRect` }>

***

#### getPartListPdf

▸ **getPartListPdf**(`planObject?`): `Promise`<`any`>

**Parameters**

| Name          | Type               |
| ------------- | ------------------ |
| `planObject?` | `KernelPlanObject` |

**Returns**

`Promise`<`any`>

***

#### getPopUpShadowStyle

▸ **getPopUpShadowStyle**(): `Object`

**Returns**

`Object`

| Name              | Type     |
| ----------------- | -------- |
| `backgroundColor` | `string` |
| `cursor`          | `string` |

***

#### giveGaConsent

▸ **giveGaConsent**(): `void`

call this method if consent of Google Analytics is given later and not already in init-data on boot

**Returns**

`void`

***

#### insertObject

▸ **insertObject**(`id`, `position?`, `rotation?`): `Promise`<`void`>

Insert an object into the current MOC/planner scene If no position or rotation is set then it will be placed automatically (without overlapping other objects) with rotation 0

**Parameters**

| Name        | Type        | Description                                       |
| ----------- | ----------- | ------------------------------------------------- |
| `id`        | `string`    |                                                   |
| `position?` | `Position3` | as x (left/right), y (up/down) and z (front/back) |
| `rotation?` | `number`    | in radians                                        |

**Returns**

`Promise`<`void`>

***

#### loadConfigurationString

▸ **loadConfigurationString**(`configurationString`): `Promise`<[`Nullable`](https://docs.roomle.com/rubens/rubens-products/modules/exposed_api._internal_#nullable)<[`LoadResponse`](https://docs.roomle.com/rubens/rubens-products/modules/exposed_api._internal_#loadresponse)>>

call this method to load the configuration string you want into the 3d Scene

**Parameters**

| Name                  | Type     | Description                                                    |
| --------------------- | -------- | -------------------------------------------------------------- |
| `configurationString` | `string` | string of the configuration, starts with `{` and ends with `}` |

**Returns**

`Promise`<[`Nullable`](https://docs.roomle.com/rubens/rubens-products/modules/exposed_api._internal_#nullable)<[`LoadResponse`](https://docs.roomle.com/rubens/rubens-products/modules/exposed_api._internal_#loadresponse)>>

null if configuration can not be loaded

***

#### loadObject

▸ **loadObject**(`id`): `Promise`<[`Nullable`](https://docs.roomle.com/rubens/rubens-products/modules/exposed_api._internal_#nullable)<[`LoadResponse`](https://docs.roomle.com/rubens/rubens-products/modules/exposed_api._internal_#loadresponse)>>

call this method to load the object you want into the 3d Scene

**Parameters**

| Name | Type     | Description                                |
| ---- | -------- | ------------------------------------------ |
| `id` | `string` | database ID of the object you want to load |

**Returns**

`Promise`<[`Nullable`](https://docs.roomle.com/rubens/rubens-products/modules/exposed_api._internal_#nullable)<[`LoadResponse`](https://docs.roomle.com/rubens/rubens-products/modules/exposed_api._internal_#loadresponse)>>

***

#### pauseConfiguring

▸ **pauseConfiguring**(): `void`

This method can be used to pause configuration If the configurator was called in view-only mode this method triggers the onBackToWebsite callback. To know when the view-only mode is activated see the description of the startConfiguring method

**Returns**

`void`

***

#### setActiveParameterGroup

▸ **setActiveParameterGroup**(`groupKey`): `void`

Changes the currently selected parameter group to a parameter group containing the specified key.

**Parameters**

| Name       | Type     | Description         |
| ---------- | -------- | ------------------- |
| `groupKey` | `string` | parameterGroup key. |

**Returns**

`void`

***

#### setPrice

▸ **setPrice**(`currencySymbol`, `price`): `void`

set the price for the UI to show most likely needed when implementing your own price service

**Parameters**

| Name             | Type     |
| ---------------- | -------- |
| `currencySymbol` | `string` |
| `price`          | `number` |

**Returns**

`void`

***

#### startConfiguring

▸ **startConfiguring**(): `void`

This method can be used to start configuration when 3d scene is only initialized as viewer first, the configurator is automatically instantiated as viewer if the container where the configurator is placed is smaller than 1024px (this breakpoint could change in future) so do not rely on this exact pixel setting

**Returns**

`void`

***

#### toggleDrawer

▸ **toggleDrawer**(): `void`

**Returns**

`void`

***

#### triggerRequestPlan

▸ **triggerRequestPlan**(): `Promise`<`void`>

call this method to trigger the onRequestPlan event from outside of the iframe. When this method is called the same process is kicked off as if the user would have clicked on request plan. Therefore you can just use the same callback to react on the response

**Returns**

`Promise`<`void`>

***

#### triggerRequestProduct

▸ **triggerRequestProduct**(): `Promise`<`void`>

call this method to trigger the onRequestProduct event from outside of the iframe. When this method is called the same process is kicked off as if the user would have clicked on request product. Therefore you can just use the same callback to react on the response

**Returns**

`Promise`<`void`>

***

#### triggerSaveDraft

▸ **triggerSaveDraft**(`email?`): `Promise`<`void`>

call this method to trigger the onSaveDraft event from outside of the iframe. When this method is called the same process is kicked off as if the user would have clicked on save draft in the bottom bar. Therefore you can just use the same callback to react on the response

**Parameters**

| Name    | Type     | Default value |
| ------- | -------- | ------------- |
| `email` | `string` | `''`          |

**Returns**

`Promise`<`void`>

***

#### triggerShowOverlay

▸ **triggerShowOverlay**(`overlay`): `Promise`<`void`>

List of overlays that can be triggered from outside the iframe. These overlays allow for controlled external triggering, ensuring that only specific, predefined overlays can be displayed from external sources.

Each overlay in the set is identified by a unique number:

* SAVE\_DRAFT: 1
* OPEN\_AR: 4
* EXPORT\_3D: 5
* TUTORIALS: 11
* LOAD\_PRODUCT: 12 (only available in Room Designer)

**Parameters**

| Name      | Type                                                                                                               |
| --------- | ------------------------------------------------------------------------------------------------------------------ |
| `overlay` | [`ExposedOverlays`](https://docs.roomle.com/rubens/rubens-products/modules/exposed_api._internal_#exposedoverlays) |

**Returns**

`Promise`<`void`>

***

#### updateDrag

▸ **updateDrag**(`x`, `y`, `options?`): `void`

After you called dragInObject you can call this method to update the drag position the coordinates x and y are relative to the iframe. Meaning 0/0 is the top left corner of the iframe

**Parameters**

| Name      | Type                                                                                                                                        | Description                  |
| --------- | ------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------- |
| `x`       | `number`                                                                                                                                    | coordinate of the drag event |
| `y`       | `number`                                                                                                                                    | coordinate of the drag event |
| `options` | [`DragInOptions`](https://docs.roomle.com/rubens/rubens-products/rubens-products-reference/interfaces/exposed_api._internal_.draginoptions) | -                            |

**Returns**

`void`

void
