All URIs are relative to https://localhost/api/v1
Method | HTTP request | Description |
---|---|---|
chat_get | GET /chat | Get chat messages. |
chat_get_channels | GET /chat/channels | Get available channels. |
chat_get_connected | GET /chat/connected | Get connected users. |
chat_new | POST /chat | Send a chat message. |
list[Chat] chat_get(count=count, start=start, reverse=reverse, channel_id=channel_id)
Get chat messages.
from __future__ import print_function
import time
import bitmex_client
from bitmex_client.rest import ApiException
from pprint import pprint
# create an instance of the API class
api_instance = bitmex_client.ChatApi()
count = 100 # float | Number of results to fetch. (optional) (default to 100)
start = 0 # float | Starting point for results. (optional) (default to 0)
reverse = true # bool | If true, will sort results newest first. (optional) (default to true)
channel_id = 1.2 # float | Channel id. GET /chat/channels for ids. Leave blank for all. (optional)
try:
# Get chat messages.
api_response = api_instance.chat_get(count=count, start=start, reverse=reverse, channel_id=channel_id)
pprint(api_response)
except ApiException as e:
print("Exception when calling ChatApi->chat_get: %s\n" % e)
Name | Type | Description | Notes |
---|---|---|---|
count | float | Number of results to fetch. | [optional] [default to 100] |
start | float | Starting point for results. | [optional] [default to 0] |
reverse | bool | If true, will sort results newest first. | [optional] [default to true] |
channel_id | float | Channel id. GET /chat/channels for ids. Leave blank for all. | [optional] |
No authorization required
- Content-Type: application/json, application/x-www-form-urlencoded
- Accept: application/json, application/xml, text/xml, application/javascript, text/javascript
[Back to top] [Back to API list] [Back to Model list] [Back to README]
list[ChatChannel] chat_get_channels()
Get available channels.
from __future__ import print_function
import time
import bitmex_client
from bitmex_client.rest import ApiException
from pprint import pprint
# create an instance of the API class
api_instance = bitmex_client.ChatApi()
try:
# Get available channels.
api_response = api_instance.chat_get_channels()
pprint(api_response)
except ApiException as e:
print("Exception when calling ChatApi->chat_get_channels: %s\n" % e)
This endpoint does not need any parameter.
No authorization required
- Content-Type: application/json, application/x-www-form-urlencoded
- Accept: application/json, application/xml, text/xml, application/javascript, text/javascript
[Back to top] [Back to API list] [Back to Model list] [Back to README]
ConnectedUsers chat_get_connected()
Get connected users.
Returns an array with browser users in the first position and API users (bots) in the second position.
from __future__ import print_function
import time
import bitmex_client
from bitmex_client.rest import ApiException
from pprint import pprint
# create an instance of the API class
api_instance = bitmex_client.ChatApi()
try:
# Get connected users.
api_response = api_instance.chat_get_connected()
pprint(api_response)
except ApiException as e:
print("Exception when calling ChatApi->chat_get_connected: %s\n" % e)
This endpoint does not need any parameter.
No authorization required
- Content-Type: application/json, application/x-www-form-urlencoded
- Accept: application/json, application/xml, text/xml, application/javascript, text/javascript
[Back to top] [Back to API list] [Back to Model list] [Back to README]
Chat chat_new(message, channel_id=channel_id)
Send a chat message.
from __future__ import print_function
import time
import bitmex_client
from bitmex_client.rest import ApiException
from pprint import pprint
# Configure API key authorization: apiKey
configuration = bitmex_client.Configuration()
configuration.api_key['api-key'] = 'YOUR_API_KEY'
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# configuration.api_key_prefix['api-key'] = 'Bearer'
# Configure API key authorization: apiNonce
configuration = bitmex_client.Configuration()
configuration.api_key['api-nonce'] = 'YOUR_API_KEY'
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# configuration.api_key_prefix['api-nonce'] = 'Bearer'
# Configure API key authorization: apiSignature
configuration = bitmex_client.Configuration()
configuration.api_key['api-signature'] = 'YOUR_API_KEY'
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# configuration.api_key_prefix['api-signature'] = 'Bearer'
# create an instance of the API class
api_instance = bitmex_client.ChatApi(bitmex_client.ApiClient(configuration))
message = 'message_example' # str |
channel_id = 1 # float | Channel to post to. Default 1 (English). (optional) (default to 1)
try:
# Send a chat message.
api_response = api_instance.chat_new(message, channel_id=channel_id)
pprint(api_response)
except ApiException as e:
print("Exception when calling ChatApi->chat_new: %s\n" % e)
Name | Type | Description | Notes |
---|---|---|---|
message | str | ||
channel_id | float | Channel to post to. Default 1 (English). | [optional] [default to 1] |
apiKey, apiNonce, apiSignature
- Content-Type: application/json, application/x-www-form-urlencoded
- Accept: application/json, application/xml, text/xml, application/javascript, text/javascript
[Back to top] [Back to API list] [Back to Model list] [Back to README]