Skip to content

Latest commit

 

History

History
194 lines (135 loc) · 5.84 KB

File metadata and controls

194 lines (135 loc) · 5.84 KB

swagger_client.ChatApi

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.

chat_get

list[Chat] chat_get(count=count, start=start, reverse=reverse, channel_id=channel_id)

Get chat messages.

Example

import time
import swagger_client
from swagger_client.rest import ApiException
from pprint import pprint

# create an instance of the API class
api_instance = swagger_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

Parameters

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]

Return type

list[Chat]

Authorization

No authorization required

HTTP request headers

  • 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_get_channels

list[ChatChannel] chat_get_channels()

Get available channels.

Example

import time
import swagger_client
from swagger_client.rest import ApiException
from pprint import pprint

# create an instance of the API class
api_instance = swagger_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

Parameters

This endpoint does not need any parameter.

Return type

list[ChatChannel]

Authorization

No authorization required

HTTP request headers

  • 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_get_connected

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.

Example

import time
import swagger_client
from swagger_client.rest import ApiException
from pprint import pprint

# create an instance of the API class
api_instance = swagger_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

Parameters

This endpoint does not need any parameter.

Return type

ConnectedUsers

Authorization

No authorization required

HTTP request headers

  • 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_new

Chat chat_new(message, channel_id=channel_id)

Send a chat message.

Example

import time
import swagger_client
from swagger_client.rest import ApiException
from pprint import pprint

# create an instance of the API class
api_instance = swagger_client.ChatApi()
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

Parameters

Name Type Description Notes
message str
channel_id float Channel to post to. Default 1 (English). [optional] [default to 1]

Return type

Chat

Authorization

No authorization required

HTTP request headers

  • 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]