Skip to content

Latest commit

 

History

History
193 lines (127 loc) · 4.45 KB

File metadata and controls

193 lines (127 loc) · 4.45 KB

SwaggerClient::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

Array<Chat> chat_get(opts)

Get chat messages.

Example

# load the gem
require 'swagger_client'

api_instance = SwaggerClient::ChatApi.new

opts = { 
  count: 100, # Float | Number of results to fetch.
  start: 0, # Float | Starting point for results.
  reverse: true, # BOOLEAN | If true, will sort results newest first.
  channel_id: 1.2 # Float | Channel id. GET /chat/channels for ids. Leave blank for all.
}

begin
  #Get chat messages.
  result = api_instance.chat_get(opts)
  p result
rescue SwaggerClient::ApiError => e
  puts "Exception when calling ChatApi->chat_get: #{e}"
end

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 BOOLEAN 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

Array<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

chat_get_channels

Array<ChatChannel> chat_get_channels

Get available channels.

Example

# load the gem
require 'swagger_client'

api_instance = SwaggerClient::ChatApi.new

begin
  #Get available channels.
  result = api_instance.chat_get_channels
  p result
rescue SwaggerClient::ApiError => e
  puts "Exception when calling ChatApi->chat_get_channels: #{e}"
end

Parameters

This endpoint does not need any parameter.

Return type

Array<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

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

# load the gem
require 'swagger_client'

api_instance = SwaggerClient::ChatApi.new

begin
  #Get connected users.
  result = api_instance.chat_get_connected
  p result
rescue SwaggerClient::ApiError => e
  puts "Exception when calling ChatApi->chat_get_connected: #{e}"
end

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

chat_new

Chat chat_new(message, opts)

Send a chat message.

Example

# load the gem
require 'swagger_client'

api_instance = SwaggerClient::ChatApi.new

message = "message_example" # String | 

opts = { 
  channel_id: 1 # Float | Channel to post to. Default 1 (English).
}

begin
  #Send a chat message.
  result = api_instance.chat_new(message, opts)
  p result
rescue SwaggerClient::ApiError => e
  puts "Exception when calling ChatApi->chat_new: #{e}"
end

Parameters

Name Type Description Notes
message String
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