---
description: >-
  This section describes the basic info and structure of WS requests and
  responses.
---

# Basic structure | WEBSOKET

### Endpoint

```javascript
ws.earnbit.com
```

{% hint style="info" %}
The connection will be closed by the server in case of inactivity from the client after 60 seconds.
{% endhint %}

### Request parameters

| Name                                     |   Type  |                            Desciption                            | Example     |
| ---------------------------------------- | :-----: | :--------------------------------------------------------------: | ----------- |
| method<mark style="color:red;">\*</mark> |  STRING |                            Method name                           | server.ping |
| params                                   |  ARRAY  |         Array of parameters required by a specific method        | -           |
| id<mark style="color:red;">\*</mark>     | NUMERIC | Request ID, Should be unique to handle response for your request | 1           |

### Response Example

|  Name  |     Type    | Success |  Error  |
| :----: | :---------: | :-----: | :-----: |
|   id   |   Integer   | NUMERIC | NUMERIC |
| params |    ARRAY    |  ARRAY  | Failure |
| result | JSON Object |  ARRAY  |   NULL  |
|  error | JSON Object |   NULL  | Failure |

### General error code:

* internal error
* service unavailable
* method not found
* service timeout
* require authentication
