# 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


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://earnbit.gitbook.io/earnbit/developers/exchange-api-documentation/basic-structure-or-websoket.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
