# Websocket JavaScript API

## Connector functions websocket JS API guide

This API allows users to send message to opened websocket.

### Websocket Object Properties

| Property | Type                | Description                                           |
| -------- | ------------------- | ----------------------------------------------------- |
| payload  | <code>\*</code>     | Data to be published. It will be converted to string. |
| deviceId | <code>String</code> | Device identifier with the opened websocket           |

### Websocket Object Methods

#### websocket.sendMsg()

Executes specified request using the properties of the `websocket object`

**Returns**: Object

Example of use:

```javascript
websocket.payload = {someField:someValue};
websocket.deviceId = 'someDeviceId'
websocket.sendMsg();
```